sails.js Use session param in model
So, if I understand you correctly, you want to avoid lots of code like this in your controllers: SomeModel.create({companyId: req.session.companyId, …}) SomeModel.find({companyId: req.session.companyId, …}) Fair enough. Maybe you’re concerned that companyId will be renamed in the future, or need to be further processed. The simplest solution if you’re using custom controller actions would be to … Read more