diff --git a/lib/SequelizeResolver.ts b/lib/SequelizeResolver.ts index b4c62f2..0e338fd 100644 --- a/lib/SequelizeResolver.ts +++ b/lib/SequelizeResolver.ts @@ -81,6 +81,7 @@ export class SequelizeResolver extends FabrixResolver { // Add a copy of the Fabrix app to the connection model this._sequelizeModel.app = this.app + // this._sequelizeModel.model = this.model // A helpful exposure of the instance of Sequelize being used this._sequelize = this._sequelizeModel.sequelize @@ -104,7 +105,7 @@ export class SequelizeResolver extends FabrixResolver { this._sequelizeModel.prototype.app = this.app // Attach Fabrix Model to the instance prototype - this._sequelizeModel.prototype.model = this.model + this._sequelizeModel.prototype.resolver = this // Add this model to the connection.models for use later this._connection.models[modelName] = this._sequelizeModel diff --git a/package-lock.json b/package-lock.json index c7a9cda..8ca27d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@fabrix/spool-sequelize", - "version": "1.6.12", + "version": "1.6.13", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 46c650f..6e6c1ae 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fabrix/spool-sequelize", - "version": "1.6.12", + "version": "1.6.13", "description": "Spool - Datastore Spool for Sequelize.js http://sequelizejs.com", "scripts": { "build": "tsc -p ./lib/tsconfig.release.json", diff --git a/test/integrations/spool.test.js b/test/integrations/spool.test.js index b43f22a..a35b866 100755 --- a/test/integrations/spool.test.js +++ b/test/integrations/spool.test.js @@ -69,8 +69,8 @@ describe('Spool', () => { it('instance should have access to model', (done) => { const instance = global.app.models.testModel.build({name: 'test'}) - assert.ok(instance.model) - assert.equal(instance.model, global.app.models.testModel) + assert.ok(instance.resolver) + assert.equal(instance.resolver, global.app.models.testModel.resolver) done() })