       @render 'build'
     else
       @render 'builds/not_found'
+
+  deactivate: ->
+    repo = @controllerFor('repo')
+    repo.set('build', null)
+    repo.set('job', null)
 
 Travis.RepoRoute = Travis.Route.extend
   renderTemplate: ->


  model: (params) ->
    Travis.Job.fetch(params.job_id)

Travis.RepoIndexRoute = Travis.Route.extend
  setupController: (controller, model) ->

  model: (params) ->
    Travis.Build.fetch(params.build_id)

  deactivate: ->
    repo = @controllerFor('repo')
    repo.set('build', null)
    repo.set('job', null)

Travis.JobRoute = Travis.Route.extend
  serialize: (model, params) ->
    id = if model.get then model.get('id') else model
