Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Console:
- { key: /^asdgfasdfg$/gi, _id: { '$ne': { '$in': [Object] } } }
- /**
- * Meta
- *
- * @module :: Model
- * @description :: A short summary of how this model works and what it represents.
- * @docs :: http://sailsjs.org/#!documentation/models
- */
- module.exports = {
- schema: true,
- attributes: {
- key: {
- type: 'string',
- required: true,
- },
- value: {
- type: 'string',
- required: true
- },
- label: {
- type: 'string',
- required: true
- },
- description: {
- type: 'string',
- },
- order: {
- type: 'integer',
- defaultsTo: 0
- },
- },
- beforeCreate: function(attrs, next) {
- attrs = formats(attrs)
- next(null, attrs);
- },
- beforeUpdate: function(attrs, next) {
- attrs = formats(attrs)
- next(null, attrs);
- }
- };
- function formats(attrs) {
- return attrs;
- }
Advertisement
Add Comment
Please, Sign In to add comment