File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -44,15 +44,17 @@ module.exports = class SequelizeTrailpack extends Trailpack {
4444 if ( model . connection == name ) {
4545 const Model = connection . define ( modelName , model . schema , model . config )
4646
47- if ( model . config . classMethods ) {
48- for ( let methodName in model . config . classMethods ) {
49- Model [ methodName ] = model . config . classMethods [ methodName ]
47+ if ( model . config ) {
48+ if ( model . config . classMethods ) {
49+ for ( const methodName in model . config . classMethods ) {
50+ Model [ methodName ] = model . config . classMethods [ methodName ]
51+ }
5052 }
51- }
5253
53- if ( model . config . instanceMethods ) {
54- for ( let methodName in model . config . instanceMethods ) {
55- Model . prototype [ methodName ] = model . config . instanceMethods [ methodName ]
54+ if ( model . config . instanceMethods ) {
55+ for ( const methodName in model . config . instanceMethods ) {
56+ Model . prototype [ methodName ] = model . config . instanceMethods [ methodName ]
57+ }
5658 }
5759 }
5860
You can’t perform that action at this time.
0 commit comments