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

Deprecation if id is Model in deserializeRecordId #3279

Merged
merged 2 commits into from
Jun 14, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/ember-data/lib/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -2058,6 +2058,7 @@ function deserializeRecordId(store, data, key, relationship, id) {

//If record objects were given to push directly, uncommon, not sure whether we should actually support
if (id instanceof Model) {
Ember.deprecate("Passing a record object to push directly into the store has been deprecated. Pass a number or string as a value to represent the record.");
Copy link
Member

Choose a reason for hiding this comment

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

Can you make the deprecation message a bit more descriptive to the user. Think about if you were to see it pop up in the console. Something with more context like:
You tried pushing a record 'recordType' with id 'id' and passed a DS.Model as a value for the relationship 'relationshipKey' etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll change it in a bit.

data[key] = id._internalModel;
return;
}
Expand Down