You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Ember Data now require you to specify an inverse relation in hasMany and belongsTo relations I wrote a crude script to check if it all maps out and if there are any inconsistencies. After I wrote it I realised that it could probably be turned into some kind of eslint rule.
Basically it would give warnings in for instance the following situation since the inverse is not correctly specified both ways:
// app/models/email.js
@belongsTo('user', {async: true, inverse: null}) user
However I'm not sure if this is within the scope of this project? If you find it relevant let me know and I can try to make a rule of it and send a PR.
Since Ember Data now require you to specify an inverse relation in
hasMany
andbelongsTo
relations I wrote a crude script to check if it all maps out and if there are any inconsistencies. After I wrote it I realised that it could probably be turned into some kind of eslint rule.Basically it would give warnings in for instance the following situation since the inverse is not correctly specified both ways:
However I'm not sure if this is within the scope of this project? If you find it relevant let me know and I can try to make a rule of it and send a PR.
Here it the script for checking inverses in Ember Data: https://gist.github.com/jede/cce91a376384fef466d70c254ad73b02
The text was updated successfully, but these errors were encountered: