Last build returned from repo should not be a promise

`store.find` returns a promise by default which resolved to a fetched model. In
case of last build we always want to return a last build record.
This commit is contained in:
Piotr Sarnacki 2015-01-28 12:06:42 +01:00
parent ac25220ef2
commit 05bc0e0574

View File

@ -32,7 +32,9 @@ Travis.Repo = Travis.Model.extend
).property('lastBuildId', 'lastBuildNumber')
lastBuild: (->
@store.find('build', @get('lastBuildId'))
id = @get('lastBuildId')
@store.find('build', id)
@store.recordForId('build', id)
).property('lastBuildId')
withLastBuild: ->