Conversation
|
Hi @iamcxa! |
|
hi @KSDaemon, this small modification can load models inside sails hook into Sequelize model. let's say --- add a project contains controller/model/service folder and make it as a Sails hook, and give it a model definition named User --- so after this modification, sails-hook-sequelize will load this User mode as a normal model into running Sails instance. p.s. you may need this to load model from hooks in Sails 1.x: https://github.com/bigbn/sails-util-mvcsloader |
pull new version back
| // then merge sails hook's model before init all models. | ||
| if (sails.models) { | ||
| const merge = sails.util ? sails.util.merge : _.merge; | ||
| const hookModels = sails.models || {}; |
There was a problem hiding this comment.
Seems that you already checked sails.models in if statement above :)
|
Hi @iamcxa Sorry for so late answer. |
…lize into KSDaemon-master
Ks daemon master
Revert "Ks daemon master"
Revert "merge from the source"
merge sails models again, in order to add hook`s model before init all models.