update routes for builds

This commit is contained in:
carlad 2015-08-21 13:48:47 +02:00
parent fe9a6536d7
commit f7634f0f39
2 changed files with 5 additions and 11 deletions

View File

@ -3,11 +3,5 @@ module Travis::API::V3
def find(repository)
repository.builds
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

View File

@ -28,6 +28,11 @@ module Travis::API::V3
post :create
end
resource :builds do
route '/builds'
get :find
end
resource :branch do
route '/branch/{branch.name}'
get :find
@ -39,11 +44,6 @@ module Travis::API::V3
get :for_current_user
end
resource :builds do
route '/builds'
get :find
end
resource :build do
capture id: :digit
route '/build/{build.id}'