-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snapshots unknown relationships #2939
Conversation
setHasData: function(value) { | ||
var inverseKey = this.inverseKey; | ||
if (inverseKey) { | ||
this.canonicalMembers.forEach(function(member) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This breaks if your inverse is a many relationship, because even though you only added one record, you are saying it has all of them. Not really sure what to do about this though. Also this seems like the wrong place, probably should happen automatically as the setHasData gets called by addCanonicalRecord
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After consulting with @stefanpenner we think it's ok to just send what we have
72b009a
to
775b8a2
Compare
}, | ||
|
||
notifyRecordRelationshipAdded: Ember.K, | ||
notifyRecordRelationshipRemoved: Ember.K, | ||
|
||
setHasData: function() { | ||
setHasData: function(value) { | ||
this.hasData = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like we should do this.hasData = value instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
775b8a2
to
94dfd68
Compare
This is the second part of solving the problem described in #2936.
Snapshots are now aware of unknown relationships and can return
undefined
frombelongsTo()
andhasMany()
if that is the case.Ping @igorT re: f67ab9c