-
-
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
Allow store.push to accept { data: null } #3866
Conversation
if (data.data === null) { | ||
return null; | ||
} | ||
|
||
var internalModel = this._pushInternalModel(data.data || data); |
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.
I think this special case (data.data || data
, I've personally never really liked it) should be considered if we return early if data.data === null
above.
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.
I believe this works because the the return null;
never gets hit if data.data
is undefined. I'd like to remove this || data
from this line if possible. It seems like we could do that if we pull one of the assertions out of _pushInternalModel
and put it into this method.
@wecc are we good here? |
LGTM! @bmac squash? |
@wecc squashed. |
Allow store.push to accept { data: null }
Maybe a warning for people upgrading that we switched to json api? |
Would it be possible to back-port this to 2.2.0? |
@jherdman yes I can release a 2.2.1 tomorrow with this fix. |
Sorry for the delay @jherdman. I just published 2.2.1 with this commit. |
No worries! I greatly appreciate the release. |
The mentioned issue has been fixed in ember-data 2.2.1 on Nov 25, 2015 (emberjs/data#3866 (comment)). The oldest version ember-local-storage currently supports is 2.12.
The mentioned issue has been fixed in ember-data 2.2.1 on Nov 25, 2015 (emberjs/data#3866 (comment)). The oldest version ember-local-storage currently supports is 2.12.
Closes #3790
cc @wecc could review this pr?