cesardeazevedo / sails-hook-sequelize-blueprints

Sails blueprints for sequelize ORM
MIT License
32 stars 19 forks source link

Update update.js #17

Closed jury89 closed 8 years ago

jury89 commented 8 years ago

added an option to set if include or not all the associations of the model updated. This because for model with many associations, the endpoint POST /modelname/:id is becomes very slow if include:all is setted

cesardeazevedo commented 8 years ago

We already have an option for populate all relations, which follows the original sails blueprints, i don't think we should add an extra option for that, we can use the req._sails.config.blueprints.populate, take a look at it. https://github.com/cesardeazevedo/sails-hook-sequelize-blueprints/blob/a55fa04522708190e872bc294dfea8b3c639ca3b/actions/findOne.js#L24

jury89 commented 8 years ago

Cool i didn't thought about it. I updated my PR

cesardeazevedo commented 8 years ago

Please, check your code, there still includeAllAfterUpdate