move find cron for repository to query
This commit is contained in:
parent
6fb0f7b6ce
commit
be01b36f05
|
@ -1,6 +1,10 @@
|
|||
module Travis::API::V3
|
||||
class Queries::Crons < Query
|
||||
|
||||
def find(repository)
|
||||
Models::Cron.where(:branch_id => repository.branches)
|
||||
end
|
||||
|
||||
def start(branch)
|
||||
raise ServerError, 'repository does not have a github_id'.freeze unless branch.repository.github_id
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ module Travis::API::V3
|
|||
paginate
|
||||
|
||||
def run!
|
||||
Models::Cron.where(:branch_id => find(:repository).branches)
|
||||
query.find(find(:repository))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user