Use VariableLookup instead of dot notation

This commit is contained in:
Guilherme Carreiro
2025-01-17 11:44:38 +01:00
parent 6372289ba3
commit e429c940a3
2 changed files with 28 additions and 4 deletions
+4 -4
View File
@@ -1007,10 +1007,10 @@ module Liquid
return value if !value.nil? || !property_or_keys.is_a?(String)
keys = property_or_keys.split('.')
keys.reduce(drop) do |drop, key|
drop.respond_to?(:[]) ? drop[key] : drop
end
variable_lookup = Liquid::VariableLookup.parse("drop.#{property_or_keys}")
variable_lookup.evaluate(
Liquid::Context.new("drop" => drop),
)
end
def raise_property_error(property)