From 935d3530af0e459e369ee4b183d5b17df1a4b388 Mon Sep 17 00:00:00 2001 From: "Mark H. Wilkinson" Date: Tue, 12 Apr 2011 14:11:06 +0100 Subject: [PATCH] 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. --- lib/liquid/drop.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/liquid/drop.rb b/lib/liquid/drop.rb index 1901871..db507eb 100644 --- a/lib/liquid/drop.rb +++ b/lib/liquid/drop.rb @@ -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