sails-hook-sequelize icon indicating copy to clipboard operation
sails-hook-sequelize copied to clipboard

merge sails hook's model

Open iamcxa opened this issue 7 years ago • 4 comments
trafficstars

merge sails models again, in order to add hook`s model before init all models.

iamcxa avatar May 26 '18 20:05 iamcxa

Coverage Status

Coverage decreased (-0.04%) to 80.822% when pulling b4c79a116ace222f18bc148e316bafd200f0276b on MoreAppio:master into b4cc3971ea0f8ad77dbbb71858d6f8b4d9bf80b6 on KSDaemon:master.

coveralls avatar May 29 '18 08:05 coveralls

Hi @iamcxa! Can you explain your changes? Sorry, i do not understand purpose and reasons behind it. Thank you!

KSDaemon avatar May 30 '18 15:05 KSDaemon

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

iamcxa avatar May 31 '18 08:05 iamcxa

Hi @iamcxa Sorry for so late answer. Will be great if you'll cover this case with test for 1.0 version!

KSDaemon avatar Oct 26 '19 14:10 KSDaemon