smarter filtering for default branch
This commit is contained in:
parent
fedc6acec1
commit
2b84d5228b
|
@ -7,14 +7,14 @@ BranchesController = Ember.Controller.extend
|
||||||
defaultBranch: (->
|
defaultBranch: (->
|
||||||
repos = @get('model')
|
repos = @get('model')
|
||||||
output = repos.filter (item, index) ->
|
output = repos.filter (item, index) ->
|
||||||
item if item.repository.default_branch.name == undefined
|
item if item.repository.default_branch['@href'] == item['@href']
|
||||||
output[0]
|
output[0]
|
||||||
).property('model')
|
).property('model')
|
||||||
|
|
||||||
activeBranches: (->
|
activeBranches: (->
|
||||||
repos = @get('model')
|
repos = @get('model')
|
||||||
repos = repos.filter (item, index) ->
|
repos = repos.filter (item, index) ->
|
||||||
item if item.exists_on_github == true && item.repository.default_branch.name != undefined
|
item if item.exists_on_github == true && item.repository.default_branch['@href'] != item['@href']
|
||||||
.sortBy('last_build.finished_at')
|
.sortBy('last_build.finished_at')
|
||||||
.reverse()
|
.reverse()
|
||||||
).property('model')
|
).property('model')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user