Skip to content

Commit

Permalink
reduce noise
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Apr 25, 2019
1 parent bacce7a commit 9e94535
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
31 changes: 22 additions & 9 deletions packages/store/addon/-private/system/model/internal-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,25 @@ export default class InternalModel {
if (DEBUG) {
let klass = this._record.constructor;
let deprecations = lookupDeprecations(klass);
debugger;
['becameError', 'becameInvalid', 'didCreate', 'didDelete', 'didLoad', 'didUpdate', 'ready', 'rolledBack'].forEach(methodName => {
[
'becameError',
'becameInvalid',
'didCreate',
'didDelete',
'didLoad',
'didUpdate',
'ready',
'rolledBack',
].forEach(methodName => {
if (typeof this._record[methodName] === 'function') {
deprecate(`Attempted to define ${methodName} on ${this._record.modelName}#${this._record.id}`, deprecations[methodName], {
id: 'ember-evented',
until: '3.12'
})
deprecate(
`Attempted to define ${methodName} on ${this._record.modelName}#${this._record.id}`,
deprecations[methodName],
{
id: 'ember-data:record-lifecycle-event-methods',
until: '3.12',
}
);
}
});
}
Expand Down Expand Up @@ -539,8 +551,8 @@ export default class InternalModel {
key,
store,
originatingInternalModel: this,
modelName: relationshipMeta.type
}
modelName: relationshipMeta.type,
};

if (isAsync) {
let internalModel =
Expand Down Expand Up @@ -1061,7 +1073,8 @@ export default class InternalModel {
let record = this._record;
let trigger = record.trigger;
for (let i = 0, l = triggers.length; i < l; i++) {
trigger.apply(record, triggers[i]);
let eventName = triggers[i];
trigger.apply(record, eventName);
}

triggers.length = 0;
Expand Down
4 changes: 3 additions & 1 deletion packages/store/addon/-private/system/model/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,9 @@ const Model = EmberObject.extend(DeprecatedEvented, {
fn.apply(this, args);
}

this._super(...arguments);
if (this._has(name)) {
this._super(...arguments);
}
},

attr() {
Expand Down

0 comments on commit 9e94535

Please sign in to comment.