1
「フォロワー/フォロー」の関係を実装しようとしています。Ember.Js Reflexive Association
アプリ/テンプレート/ users.hbs ---------------------------
{{#each model as |user|}}
...
<button {{action 'follow' user}}>Follow</button>
{{/each}}
アプリ/路線/ユーザー.js ---------------------------
follow(user){
//currentUser is the one clicking on 'follow' button
//and it works.I can successfully alert it's properties.
currentUser.get('followings').pushObject(user);
},
app/models/user.js ------- ----------------
...
followings: DS.hasMany('user',{inverse: null}),
followers: DS.hasMany('user',{inverse: null}),
ここで、この解決策がこのエラーの原因です。
Uncaught TypeError: Cannot read the property 'modelName' of undefined at assertPolymorphicType.notifyRecordRelationshipAdded