Skip to content

Commit

Permalink
Support findAll/pluck #238
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Mar 7, 2024
1 parent e7387cb commit b5a8191
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion grails-app/assets/javascripts/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,21 @@ function orEmptyArray(v) {
}

return moment(value).format('DD-MM-YYYY');
}
};

parser.functions.findAll = function(list, property, value) {
var obj = {};
obj[property] = value;
return _.where(list, obj);
};

parser.functions.pluck = function(list, property, defaultValue) {
var result = _.pluck(list, property);
if (!result || result.length == 0) {
result = [defaultValue];
}
return result;
};

var specialBindings = function() {

Expand Down

0 comments on commit b5a8191

Please sign in to comment.