@@ -3835,6 +3836,7 @@ var storeAlias = function(methodName) {
args=[].slice.call(arguments);
args.unshift(this);
Ember.assert("Your application does not have a 'Store' property defined. Attempts to call '"+methodName+"' on model classes will fail. Please provide one as with 'YourAppName.Store = DS.Store.extend()'",!!store);
returnstore[methodName].apply(store,args);
};
};
...
...
@@ -3843,6 +3845,7 @@ DS.Model.reopenClass({
isLoaded:storeAlias('recordIsLoaded'),
find:storeAlias('find'),
all:storeAlias('all'),
query:storeAlias('findQuery'),
filter:storeAlias('filter'),
_create:DS.Model.create,
...
...
@@ -4180,7 +4183,6 @@ DS.Model.reopenClass({
App.Blog = DS.Model.extend({
users: DS.hasMany(App.User),
owner: DS.belongsTo(App.User),
posts: DS.hasMany(App.Post)
});
...
...
@@ -4256,6 +4258,51 @@ DS.Model.reopenClass({
returnnames;
}),
/**
An array of types directly related to a model. Each type will be
included once, regardless of the number of relationships it has with
the model.
For example, given a model with this definition:
App.Blog = DS.Model.extend({
users: DS.hasMany(App.User),
owner: DS.belongsTo(App.User),
posts: DS.hasMany(App.Post)
});
This property would contain the following:
var relatedTypes = Ember.get(App.Blog, 'relatedTypes');
//=> [ App.User, App.Post ]
@type Ember.Array
@readOnly
*/
relatedTypes:Ember.computed(function(){
vartype,
types=Ember.A([]);
// Loop through each computed property on the class,
// and create an array of the unique types involved
Ember.assert("Your model specified the '"+attributeType+"' type for the '"+name+"' attribute, but no transform for that type was registered",transform);