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
# execute callback if record got loaded
col = @
App[ @className ].one 'refresh', (record) ->
delay = =>
data = App[ @className ].find( id )
if callback
App[ @className ].one 'refresh', (records) ->
for record in records
if record.id.toString() is id.toString()
data = App[ @className ].find( record.id )
callback( data )
window.setTimeout(delay, 200)
# fetch object
console.log 'debug', 'loading..' + @className + '..', id