Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaurav0 committed Dec 10, 2019
1 parent 68577ab commit 90feeae
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions packages/store/addon/-private/system/references/belongs-to.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,13 @@ export default class BelongsToReference extends Reference {
return resolve(objectOrPromise).then(data => {
let record;

if (DEPRECATE_BELONGS_TO_REFERENCE_PUSH) {
if (peekRecordIdentifier(data)) {
deprecate('Pushing a record into a BelongsToReference is deprecated', false, {
id: 'ember-data:belongs-to-reference-push-record',
until: '4.0',
});
record = data;
}
}

if (typeof record === 'undefined') {
if (DEPRECATE_BELONGS_TO_REFERENCE_PUSH && peekRecordIdentifier(data)) {
deprecate('Pushing a record into a BelongsToReference is deprecated', false, {
id: 'ember-data:belongs-to-reference-push-record',
until: '4.0',
});
record = data;
} else {
record = this.store.push(data);
}

Expand Down

0 comments on commit 90feeae

Please sign in to comment.