Fix removal of the filter keyword for field type comparison

This commit is contained in:
David Thomas 2018-07-13 19:25:40 -04:00
parent 422530ceed
commit c785248b2c

View File

@ -463,7 +463,10 @@ module.exports = {
if (modelAttributes[key]) {
fieldType = modelAttributes[key]['type'];
} else {
let splitKey = key.split('_').pop();
// Remove the filter keyword at the end
let splitKey = key.split('_').slice(0,-1);
splitKey = splitKey.join('_');
if (modelAttributes[splitKey]) {
fieldType = modelAttributes[splitKey]['type'];
}