@@ -37,15 +37,15 @@ class Condition
3737
3838 MATCHING_FUNCTIONS = {
3939 EQUAL => -> ( other_value , self_value ) { other_value == self_value } ,
40- GREATER_THAN => -> ( other_value , self_value ) { other_value && other_value > self_value } ,
41- GREATER_THAN_INCLUSIVE => -> ( other_value , self_value ) { other_value && other_value >= self_value } ,
42- LESS_THAN => -> ( other_value , self_value ) { other_value && other_value < self_value } ,
43- LESS_THAN_INCLUSIVE => -> ( other_value , self_value ) { other_value && other_value <= self_value } ,
40+ GREATER_THAN => -> ( other_value , self_value ) { ( other_value || false ) && other_value > self_value } ,
41+ GREATER_THAN_INCLUSIVE => -> ( other_value , self_value ) { ( other_value || false ) && other_value >= self_value } ,
42+ LESS_THAN => -> ( other_value , self_value ) { ( other_value || false ) && other_value < self_value } ,
43+ LESS_THAN_INCLUSIVE => -> ( other_value , self_value ) { ( other_value || false ) && other_value <= self_value } ,
4444 NOT_EQUAL => -> ( other_value , self_value ) { other_value != self_value } ,
45- CONTAINS => -> ( other_value , self_value ) { other_value & .include? self_value } ,
45+ CONTAINS => -> ( other_value , self_value ) { ( other_value || false ) && other_value . include? ( self_value ) } ,
4646
47- NOT_CONTAINS => -> ( other_value , self_value ) { ! other_value & .include? self_value } ,
48- REGEX => -> ( other_value , self_value ) { other_value & .match? self_value }
47+ NOT_CONTAINS => -> ( other_value , self_value ) { ( other_value || false ) && ! other_value . include? ( self_value ) } ,
48+ REGEX => -> ( other_value , self_value ) { ( other_value || false ) && other_value . match? ( self_value ) }
4949 } . freeze
5050
5151 def initialize ( operator :, value :, property : nil )
0 commit comments