relationshipsByNameEmber.Map
static
A map whose keys are the relationships of a model and whose values are relationship descriptors.
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 relationshipsByName = Ember.get(Blog, 'relationshipsByName'); relationshipsByName.get('users'); //=> { key: 'users', kind: 'hasMany', type: 'user', options: Object, isRelationship: true } relationshipsByName.get('owner'); //=> { key: 'owner', kind: 'belongsTo', type: 'user', options: Object, isRelationship: true }
Please login to continue.