diff --git a/addon/index.js b/addon/index.js index 1895cf5..54ebc52 100644 --- a/addon/index.js +++ b/addon/index.js @@ -5,7 +5,7 @@ import isEqual from 'lodash-es/isEqual'; export default Mixin.create({ init() { - this._super(); + this._super(...arguments); this._relationshipTracker = Object.create(null); }, diff --git a/tests/integration/mixins/track-relationships-test.js b/tests/integration/mixins/track-relationships-test.js index e6cf654..ca0e705 100644 --- a/tests/integration/mixins/track-relationships-test.js +++ b/tests/integration/mixins/track-relationships-test.js @@ -1,6 +1,7 @@ import Model, { hasMany, belongsTo, attr } from '@ember-data/model'; import JSONAPISerializer from '@ember-data/serializer/json-api'; import { run } from '@ember/runloop'; +import EmberObject from '@ember/object'; import { resolve, all } from 'rsvp'; import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; @@ -417,3 +418,17 @@ module('Integration | Mixin | track relationships as Class', function(hooks) { }); }); }); + +module('Integration | Mixin | base class init receives args', function () { + test('it receives args', function (assert) { + let receivedArgs; + class ExampleModel extends EmberObject.extend(TrackRelationships) { + init() { + receivedArgs = arguments; + } + } + const model = new ExampleModel(); + model.init(['a', 3]); + assert.deepEqual(receivedArgs, ['a', 3]); + }); +});