mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-19 02:40:41 -07:00
Merge branch 'master' of [email protected]:tobi/liquid
Conflicts: lib/liquid.rb lib/liquid/context.rb lib/liquid/variable.rb test/standard_tag_test.rb
This commit is contained in:
+7
-11
@@ -56,7 +56,7 @@ module Liquid
|
||||
if strainer.respond_to?(method)
|
||||
strainer.__send__(method, *args)
|
||||
else
|
||||
args.first
|
||||
raise FilterNotFound, "Filter '#{method}' not found"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -156,16 +156,12 @@ module Liquid
|
||||
# fetches an object starting at the local scope and then moving up
|
||||
# the hierachy
|
||||
def find_variable(key)
|
||||
@scopes.each do |scope|
|
||||
if scope.has_key?(key)
|
||||
variable = scope[key]
|
||||
variable = scope[key] = variable.call(self) if variable.is_a?(Proc)
|
||||
variable = variable.to_liquid
|
||||
variable.context = self if variable.respond_to?(:context=)
|
||||
return variable
|
||||
end
|
||||
end
|
||||
nil
|
||||
scope = @scopes[0..-2].find { |s| s.has_key?(key) } || @scopes.last
|
||||
variable = scope[key]
|
||||
variable = scope[key] = variable.call(self) if variable.is_a?(Proc)
|
||||
variable = variable.to_liquid
|
||||
variable.context = self if variable.respond_to?(:context=)
|
||||
return variable
|
||||
end
|
||||
|
||||
# resolves namespaced queries gracefully.
|
||||
|
||||
Reference in New Issue
Block a user