Skip to content
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

Merged
merged 2 commits into from
Apr 12, 2015

Conversation

wecc
Copy link
Contributor

@wecc wecc commented Mar 25, 2015

This is the second part of solving the problem described in #2936.

Snapshots are now aware of unknown relationships and can return undefined from belongsTo() and hasMany() if that is the case.

Ping @igorT re: f67ab9c

setHasData: function(value) {
var inverseKey = this.inverseKey;
if (inverseKey) {
this.canonicalMembers.forEach(function(member) {
Copy link
Member

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

Copy link
Member

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

@wecc wecc force-pushed the snapshots-unknown-relationships branch 3 times, most recently from 72b009a to 775b8a2 Compare April 6, 2015 11:57
},

notifyRecordRelationshipAdded: Ember.K,
notifyRecordRelationshipRemoved: Ember.K,

setHasData: function() {
setHasData: function(value) {
this.hasData = true;
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@wecc wecc force-pushed the snapshots-unknown-relationships branch from 775b8a2 to 94dfd68 Compare April 8, 2015 18:45
igorT added a commit that referenced this pull request Apr 12, 2015
@igorT igorT merged commit 7e4f137 into emberjs:master Apr 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants