Return array and not a promise from Repo.search

This commit is contained in:
Piotr Sarnacki 2015-02-11 12:58:45 +01:00
parent 9c149313f7
commit 4afd7db020

View File

@ -149,7 +149,14 @@ Repo.reopenClass
repos
search: (store, query) ->
store.find('repo', search: query, orderBy: 'name')
promise = store.find('repo', search: query, orderBy: 'name')
result = Ember.ArrayProxy.create(content: [])
promise.then ->
result.pushObjects(promise.get('content').toArray())
result.set('isLoaded', true)
result
withLastBuild: (store) ->
repos = store.filter('repo', {}, (build) ->