Fixed Model.retrieve()

This commit is contained in:
Martin Edenhofer 2013-10-31 23:35:58 +01:00
parent 25f576ca35
commit a7a48cfa96

View file

@ -114,13 +114,11 @@ class App.Model extends Spine.Model
if callback if callback
# execute callback if record got loaded # execute callback if record got loaded
col = @ App[ @className ].one 'refresh', (records) ->
App[ @className ].one 'refresh', (record) -> for record in records
delay = => if record.id.toString() is id.toString()
data = App[ @className ].find( id ) data = App[ @className ].find( record.id )
if callback
callback( data ) callback( data )
window.setTimeout(delay, 200)
# fetch object # fetch object
console.log 'debug', 'loading..' + @className + '..', id console.log 'debug', 'loading..' + @className + '..', id