From 8933044cb5b3c13f4b2dc413e82a8ae400d368ab Mon Sep 17 00:00:00 2001 From: Mike Angell Date: Fri, 30 Aug 2019 10:04:18 +1000 Subject: [PATCH] static_environment bug --- lib/liquid/context.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/liquid/context.rb b/lib/liquid/context.rb index 0eca987..d74b0ce 100644 --- a/lib/liquid/context.rb +++ b/lib/liquid/context.rb @@ -193,7 +193,7 @@ module Liquid # path and find_index() is optimized in MRI to reduce object allocation scope = (index = @scopes.find_index { |s| s.key?(key) }) && @scopes[index] scope ||= (index = @environments.find_index { |s| s.key?(key) || !s.default_proc.nil? }) && @environments[index] - scope ||= (index = @static_environments.find_index { |s| s.key?(key) }) && @environments[index] + scope ||= (index = @static_environments.find_index { |s| s.key?(key) }) && @static_environments[index] scope ||= {} variable = lookup_and_evaluate(scope, key, raise_on_not_found: raise_on_not_found).to_liquid