Last active
August 29, 2015 14:05
-
-
Save mmun/a9855b1512aedb51ec7c to your computer and use it in GitHub Desktop.
reload_has_many_links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DS.Model.reopen | |
reloadHasManyLink: (key) -> | |
meta = @constructor.metaForProperty(key) | |
link = @_data.links[meta.key] | |
# this accounts for what seems to be an inconsistency in ember-data | |
if typeof meta.type == 'string' | |
meta.type = @store.modelFor(meta.type) | |
resolver = Ember.RSVP.defer() | |
@store.findHasMany(this, link, meta, resolver) | |
return resolver.promise |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment