introduce to_liquid_value on variable look and conditional statements

This commit is contained in:
Michael Go
2021-05-26 17:27:18 -03:00
parent b9e0d28729
commit e361a4d53c
7 changed files with 100 additions and 4 deletions
+3
View File
@@ -40,6 +40,9 @@ module Liquid
@lookups.each_index do |i|
key = context.evaluate(@lookups[i])
# Cast "key" to its liquid value to enable it to act as a primitive value
key = Liquid::Utils.to_liquid_value(key)
# If object is a hash- or array-like object we look for the
# presence of the key and if its available we return it
if object.respond_to?(:[]) &&