'contains' operator returns false if either operand is nil

This commit is contained in:
James MacAulay
2009-08-19 19:38:31 -04:00
parent 0150067c40
commit d1d6febfc1
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ module Liquid
'>' => :>,
'>=' => :>=,
'<=' => :<=,
'contains' => lambda { |cond, left, right| left.include?(right) },
'contains' => lambda { |cond, left, right| left && right ? left.include?(right) : false }
}
def self.operators