Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Ember.hasMany upgrades.
Ember.HasManyArray.serialize = function (hasManyArray) {
return hasManyArray.get('content');
Ember.hasMany = function (klassOrString, key) {
return Ember.computed(function () {
var klass;
if (typeof klassOrString === "string") {
klass = Ember.get(Ember.lookup, klassOrString);
} else {
klass = klassOrString;
return Ember.HasManyArray.create({
parent: this,
modelClass: klass,
content: get(this, 'data.' + key)
}).property().meta({ isAttribute: true, type: Ember.HasManyArray });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.