From 2256ddeb467852965dcaa9b00cd83b1f36532cc1 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Tue, 26 Feb 2013 12:04:37 +0100 Subject: [PATCH] Get rid of updateAssociations method It seems that with current version of ember-data it's not longer needed - associations are updated automatically now. --- assets/scripts/app/store.coffee | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/assets/scripts/app/store.coffee b/assets/scripts/app/store.coffee index db0abeb3..d9620289 100644 --- a/assets/scripts/app/store.coffee +++ b/assets/scripts/app/store.coffee @@ -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');