diff --git a/app/controllers/branches.coffee b/app/controllers/branches.coffee index 9a80c996..d5630011 100644 --- a/app/controllers/branches.coffee +++ b/app/controllers/branches.coffee @@ -16,26 +16,16 @@ BranchesController = Ember.Controller.extend repos = repos.filter (item, index) -> console.log(item) item if item.exists_on_github == true && item.repository.default_branch.name != undefined - .sort (a, b) -> - # if a.last_build && b.last_build - - # if a.last_build.finished_at == null - # return 1 - # else - # if a.last_build.finished_at > b.last_build.finished_at - # return -1 - # else if a.last_build.finished_at < b.last_build.finished_at - # return 1 - # else - # return 0 - # else - # return -1 + .sortBy('last_build.finished_at') + .reverse() ).property('model') inactiveBranches: (-> repos = @get('model') repos = repos.filter (item, index) -> item if item.exists_on_github == false + .sortBy('last_build.finished_at') + .reverse() ).property('model') `export default BranchesController`