Fix build and job routes
This commit is contained in:
parent
599e6f0bf9
commit
6e987d7599
|
@ -1,7 +1,6 @@
|
|||
require 'routes/route'
|
||||
require 'models/build'
|
||||
|
||||
Build = Travis.Build
|
||||
TravisRoute = Travis.Route
|
||||
|
||||
Route = TravisRoute.extend
|
||||
|
@ -11,16 +10,16 @@ Route = TravisRoute.extend
|
|||
{ build_id: id }
|
||||
|
||||
setupController: (controller, model) ->
|
||||
model = Build.find(model) if model && !model.get
|
||||
if model && !model.get
|
||||
model = @store.recordForId('build', model)
|
||||
@store.find('build', model)
|
||||
|
||||
repo = @controllerFor('repo')
|
||||
#repo.set('build', model)
|
||||
@controllerFor('build').set('build', model)
|
||||
repo.activate('build')
|
||||
#repo.set('build', model)
|
||||
|
||||
model: (params) ->
|
||||
Build.fetch(params.build_id)
|
||||
@store.find('build', params.build_id)
|
||||
|
||||
deactivate: ->
|
||||
@controllerFor('job').set('job', null)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
require 'routes/route'
|
||||
require 'models/job'
|
||||
|
||||
Job = Travis.Job
|
||||
TravisRoute = Travis.Route
|
||||
|
||||
Route = TravisRoute.extend
|
||||
|
@ -11,7 +10,9 @@ Route = TravisRoute.extend
|
|||
{ job_id: id }
|
||||
|
||||
setupController: (controller, model) ->
|
||||
model = @store.find('job', model) if model && !model.get
|
||||
if model && !model.get
|
||||
model = @store.recordForId('job', model)
|
||||
@store.find('job', model)
|
||||
|
||||
repo = @controllerFor('repo')
|
||||
@controllerFor('job').set('job', model)
|
||||
|
|
Loading…
Reference in New Issue
Block a user