mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 19:30:47 -07:00
Handle invoking drops for keys that are not strings.
For example, {{ pages[8] ... }} will result in the integer value 8 being
passed to invoke_drop.
This commit is contained in:
+4
-4
@@ -28,11 +28,11 @@ module Liquid
|
|||||||
end
|
end
|
||||||
|
|
||||||
# called by liquid to invoke a drop
|
# called by liquid to invoke a drop
|
||||||
def invoke_drop(method)
|
def invoke_drop(method_or_key)
|
||||||
if self.class.public_method_defined?(method)
|
if self.class.public_method_defined?(method_or_key.to_s.to_sym)
|
||||||
send(method)
|
send(method_or_key.to_s.to_sym)
|
||||||
else
|
else
|
||||||
before_method(method)
|
before_method(method_or_key)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user