wejsv2old-plugin-rating
Version:
We.js v2 Old - Rating Plugin
32 lines (30 loc) • 523 B
JavaScript
/**
* RatingManager
*
* @module :: RatingManager
* @description :: Manage where rating is allowed
*
*/
module.exports = {
schema: true,
types: {
isModel: function(model){
if (!model) return false;
return Object.keys(sails.models).indexOf(model) > -1;
}
},
attributes: {
modelName: {
type: 'string',
isModel: true
},
vocabulary: {
model: 'vocabulary',
required: true
},
active: {
type: 'boolean',
defaultsTo: true
}
}
};