Get rid of updateAssociations method

It seems that with current version of ember-data it's not longer needed
- associations are updated automatically now.
This commit is contained in:
Piotr Sarnacki 2013-02-26 12:04:37 +01:00
parent 12da46a623
commit 2256ddeb46

View File

@ -140,8 +140,6 @@ Travis.Store = DS.Store.extend
result = @merge(type, hash, true)
if result && result.clientId
@addLoadedData(type, result.clientId, hash)
# TODO: it will be probably needed to uncomment and fix this
#@_updateAssociations(type, type.singularName(), hash)
result
@ -159,14 +157,3 @@ Travis.Store = DS.Store.extend
root = type.pluralName()
@adapter.sideload(store, type, json, root)
@loadMany(type, json[root])
_updateAssociations: (type, name, data) ->
Em.get(type, 'associationsByName').forEach (key, meta) =>
if meta.kind == 'belongsTo'
id = data["#{key}_id"]
if clientId = @typeMapFor(meta.type).idToCid[id]
if parent = this.findByClientId(meta.type, clientId, id)
dataProxy = parent.get('data')
if ids = dataProxy.get("#{name}_ids")
ids.pushObject(data.id) unless data.id in ids
parent.send('didChangeData');