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:
Mark H. Wilkinson
2011-04-12 14:11:06 +01:00
parent 662b2983fe
commit 935d3530af

View File

@@ -28,11 +28,11 @@ module Liquid
end
# called by liquid to invoke a drop
def invoke_drop(method)
if self.class.public_method_defined?(method)
send(method)
def invoke_drop(method_or_key)
if self.class.public_method_defined?(method_or_key.to_s.to_sym)
send(method_or_key.to_s.to_sym)
else
before_method(method)
before_method(method_or_key)
end
end