-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
merge sails hook's model #54
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.