use Job::Test
This commit is contained in:
parent
76324f00a1
commit
cca12ce0c9
|
@ -46,11 +46,11 @@ module Travis
|
|||
end
|
||||
|
||||
get '/jobs' do
|
||||
respond_with Service::Jobs.new(params).collection
|
||||
respond_with Service::Jobs.new(params).collection, :type => 'jobs'
|
||||
end
|
||||
|
||||
get '/jobs/:id' do
|
||||
respond_with Service::Jobs.new(params).item
|
||||
respond_with Service::Jobs.new(params).item, :type => 'job'
|
||||
end
|
||||
|
||||
get '/artifacts/:id' do
|
||||
|
@ -88,8 +88,8 @@ module Travis
|
|||
@user = User.find_by_login('svenfuchs')
|
||||
end
|
||||
|
||||
def respond_with(resource, params = {})
|
||||
Travis::Api.data(resource, :params => self.params.merge(params), :version => version).to_json
|
||||
def respond_with(resource, options = {})
|
||||
Travis::Api.data(resource, { :params => params, :version => version }.merge(options)).to_json
|
||||
end
|
||||
|
||||
def version
|
||||
|
|
|
@ -5,16 +5,16 @@ module Travis
|
|||
class Jobs < Service
|
||||
def collection
|
||||
if params[:ids]
|
||||
Job.where(:id => params[:ids]).includes(:commit, :log)
|
||||
Job::Test.where(:id => params[:ids]).includes(:commit, :log)
|
||||
else
|
||||
jobs = Job.queued.includes(:commit, :log)
|
||||
jobs = Job::Test.queued.includes(:commit, :log)
|
||||
jobs = jobs.where(:queue => params[:queue]) if params[:queue]
|
||||
jobs
|
||||
end
|
||||
end
|
||||
|
||||
def item
|
||||
Job.find(params[:id])
|
||||
Job::Test.find(params[:id])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user