update routes for builds
This commit is contained in:
parent
fe9a6536d7
commit
f7634f0f39
|
@ -3,11 +3,5 @@ module Travis::API::V3
|
||||||
def find(repository)
|
def find(repository)
|
||||||
repository.builds
|
repository.builds
|
||||||
end
|
end
|
||||||
|
|
||||||
def count(repository, time_frame)
|
|
||||||
find(repository).
|
|
||||||
where(event_type: 'api'.freeze, result: 'accepted'.freeze).
|
|
||||||
where('created_at > ?'.freeze, time_frame.ago).count
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -28,6 +28,11 @@ module Travis::API::V3
|
||||||
post :create
|
post :create
|
||||||
end
|
end
|
||||||
|
|
||||||
|
resource :builds do
|
||||||
|
route '/builds'
|
||||||
|
get :find
|
||||||
|
end
|
||||||
|
|
||||||
resource :branch do
|
resource :branch do
|
||||||
route '/branch/{branch.name}'
|
route '/branch/{branch.name}'
|
||||||
get :find
|
get :find
|
||||||
|
@ -39,11 +44,6 @@ module Travis::API::V3
|
||||||
get :for_current_user
|
get :for_current_user
|
||||||
end
|
end
|
||||||
|
|
||||||
resource :builds do
|
|
||||||
route '/builds'
|
|
||||||
get :find
|
|
||||||
end
|
|
||||||
|
|
||||||
resource :build do
|
resource :build do
|
||||||
capture id: :digit
|
capture id: :digit
|
||||||
route '/build/{build.id}'
|
route '/build/{build.id}'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user