From a5c3cf69f297805284a520698cd284c1ee0405a0 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Tue, 13 Oct 2015 18:39:31 +0200 Subject: [PATCH] fix branches after api cleanup --- app/controllers/branches.coffee | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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')