Permalink
Browse files

add back the support for embedded assocaitions

  • Loading branch information...
mspisars committed Oct 19, 2012
1 parent 7f1b03f commit fde61a01123cb678a8bd4ab6f78de1526b6c10b8
@@ -18,7 +18,7 @@ var hasAssociation = function(type, options, one) {
type = get(this, type, false) || get(window, type);
}
- id = data[key];
+ id = options.embedded ? store.load(type, data[key]).id : data[key];
return id ? store.find(type, id) : null;
}).property('data').cacheable().meta(meta);
};
@@ -16,7 +16,7 @@ var hasAssociation = function(type, options) {
type = get(this, type, false) || get(window, type);
}
- ids = data[key];
+ ids = options.embedded ? store.loadMany(type, data[key]).ids : data[key];
association = store.findMany(type, ids || [], this, meta);
set(association, 'owner', this);
set(association, 'name', key);

0 comments on commit fde61a0

Please sign in to comment.