relationshipNamesObject
static
A hash containing lists of the model's relationships, grouped by the relationship kind. For example, given a model with this definition:
app/models/blog.js
import DS from 'ember-data'; export default DS.Model.extend({ users: DS.hasMany('user'), owner: DS.belongsTo('user'), posts: DS.hasMany('post') });
This property would contain the following:
import Ember from 'ember'; import Blog from 'app/models/blog'; var relationshipNames = Ember.get(Blog, 'relationshipNames'); relationshipNames.hasMany; //=> ['users', 'posts'] relationshipNames.belongsTo; //=> ['owner']
Please login to continue.