Skip to content

Commit

Permalink
Merge pull request #3279 from joelalejandro/pr-issue-3271
Browse files Browse the repository at this point in the history
Deprecation if id is Model in deserializeRecordId
  • Loading branch information
igorT committed Jun 14, 2015
2 parents c093d72 + 45662c5 commit c4376c0
Showing 1 changed file with 1 addition and 0 deletions.
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 @@ -2157,6 +2157,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("You tried to push a record '" + relationship.parentType + "'' with id '" + Ember.inspect(id) + "' and passed a DS.Model instance as a value for the relationship '" + key + "'. You should instead pass a numerical or string id to represent the record.");
data[key] = id._internalModel;
return;
}
Expand Down

0 comments on commit c4376c0

Please sign in to comment.