UNPKG

wejsv2old-plugin-rating

Version:
20 lines (18 loc) 552 B
/** * modelsAlter hook * * run after we.js load all plugin resources and after sails.js process the model schemes * use it to alter a model or insert extra attributes in other plugin module * * @param {object} sails current sails.js object * @param {Function} cb callback */ module.exports = function modelsAlter(sails, cb) { // models scheme are avaible in sails.models['model-name'] sails.models.term.attributes.termsRated = { collection: 'RatingVote', via: 'terms' } // Always remember to run the callback cb(); };