diff --git a/app/controllers/branches.coffee b/app/controllers/branches.coffee index ae8144e8..00fc8a80 100644 --- a/app/controllers/branches.coffee +++ b/app/controllers/branches.coffee @@ -7,15 +7,16 @@ BranchesController = Ember.Controller.extend defaultBranch: (-> repos = @get('model') output = repos.filter (item, index) -> - item if item.repository.default_branch['@href'] == item['@href'] - output[0] + item if item.default_branch == true + if output.length + output[0] ).property('model') activeBranches: (-> repos = @get('model') repos = repos.filter (item, index) -> - item if item.exists_on_github == true && item.repository.default_branch['@href'] != item['@href'] - .sortBy('last_build.finished_at') + item if item.exists_on_github == true && item.default_branch == false + .sortBy('default_branch.last_build.finished_at') .reverse() ).property('model')