greuge validations

This commit is contained in:
Carlos Jimenez 2018-01-11 11:22:56 +01:00
parent c86808603e
commit 959e5b4543
1 changed files with 8 additions and 0 deletions

View File

@ -1,4 +1,12 @@
module.exports = function(Self) { module.exports = function(Self) {
require('../methods/greuge/filter.js')(Self); require('../methods/greuge/filter.js')(Self);
require('../methods/greuge/totalGreuge.js')(Self); require('../methods/greuge/totalGreuge.js')(Self);
Self.validatesPresenceOf('description', 'amount', 'greugeTypeFk', {
message: 'Importe es un campo obligatorio'
});
Self.validatesLengthOf('description', {
max: 45,
message: 'description es un campo max 45'
});
}; };