mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 15:30:39 -07:00
Fixed condition constains operator with wrong data type
"contains" operator on wrong data type should not cause NoMethodError.
This commit is contained in:
@@ -15,7 +15,9 @@ module Liquid
|
||||
'>'.freeze => :>,
|
||||
'>='.freeze => :>=,
|
||||
'<='.freeze => :<=,
|
||||
'contains'.freeze => lambda { |cond, left, right| left && right ? left.include?(right) : false }
|
||||
'contains'.freeze => lambda { |cond, left, right|
|
||||
left && right && left.respond_to?(:include?) ? left.include?(right) : false
|
||||
}
|
||||
}
|
||||
|
||||
def self.operators
|
||||
|
||||
Reference in New Issue
Block a user