Skip to content
Snippets Groups Projects
Commit 93796eda authored by Anony's avatar Anony
Browse files

Fix for issue 1338, should allow for future between rules on nested properties

parent 9f0d7afe
Branches
Tags
1 merge request!5862Fix for issue 1338 & #1296, should allow for future between rules on nested properties
...@@ -200,8 +200,20 @@ window.ruleAppliesP = function ruleAppliesP(cond, slave) { ...@@ -200,8 +200,20 @@ window.ruleAppliesP = function ruleAppliesP(cond, slave) {
flag = false; flag = false;
break; break;
case "between": // between two values of a slave's attribute case "between": // between two values of a slave's attribute
let slaveAttribute = slave[cond.data.attribute];
if (slaveAttribute === undefined && cond.data.attribute.includes(".")) {
slaveAttribute = cond.data.attribute
.split(".")
.reduce(
(reduceSlave, attribute) =>
(reduceSlave && reduceSlave[attribute] !== undefined)
? reduceSlave[attribute]
: undefined,
slave
);
}
flag = between( flag = between(
slave[cond.data.attribute], slaveAttribute,
cond.data.value[0], cond.data.value[0],
cond.data.value[1]); cond.data.value[1]);
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment