
One thing that is not standard here is a serializer for branch, which uses @href as id. At this point branches don't have ids and ember-data needs one, so using @href is the easiest way.
22 lines
543 B
CoffeeScript
22 lines
543 B
CoffeeScript
`import TravisRoute from 'travis/routes/basic'`
|
|
|
|
Route = TravisRoute.extend
|
|
setupController: (controller, model) ->
|
|
@_super.apply this, arguments
|
|
@controllerFor('repo').activate('current')
|
|
|
|
renderTemplate: ->
|
|
if @modelFor('repo').get('defaultBranch.lastBuild')
|
|
@render 'build'
|
|
else
|
|
@render 'builds/not_found'
|
|
|
|
deactivate: ->
|
|
repo = @controllerFor('repo')
|
|
@controllerFor('build').set('build', null)
|
|
@controllerFor('job').set('job', null)
|
|
|
|
@_super.apply(this, arguments)
|
|
|
|
`export default Route`
|