From 913a0f6acaf1978ca06dbc8f3c39c3d1fa6a323d Mon Sep 17 00:00:00 2001 From: scott-wyatt Date: Tue, 31 Jul 2018 19:10:16 -0400 Subject: [PATCH] [feat] check that resolver is a sequelize resolver --- lib/transformer.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/transformer.ts b/lib/transformer.ts index 00bd78d..0356d1b 100755 --- a/lib/transformer.ts +++ b/lib/transformer.ts @@ -3,6 +3,7 @@ import * as Sequelize from 'sequelize' import { FabrixApp } from '@fabrix/fabrix' import { FabrixModel } from '@fabrix/fabrix/dist/common' import { pickBy, isString, startsWith } from 'lodash' +import { SequelizeResolver } from './SequelizeResolver' export const Transformer = { BreakException: {}, @@ -185,6 +186,9 @@ export const Transformer = { if (!model.resolver || !model.resolver.connect) { throw new Error(`${modelName} was set to use Sequelize but the resolver is missing "connect"`) } + if (!(model.resolver instanceof SequelizeResolver)) { + throw new Error(`${modelName} is not a Sequelize Resolver`) + } model.store = store model.migrate = migrate