mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
Fix regression with calling a drop with a empty string
This commit is contained in:
@@ -29,7 +29,7 @@ module Liquid
|
||||
|
||||
# called by liquid to invoke a drop
|
||||
def invoke_drop(method_or_key)
|
||||
if self.class.public_method_defined?(method_or_key.to_s.to_sym)
|
||||
if method_or_key != '' && self.class.public_method_defined?(method_or_key.to_s.to_sym)
|
||||
send(method_or_key.to_s.to_sym)
|
||||
else
|
||||
before_method(method_or_key)
|
||||
|
||||
@@ -155,4 +155,8 @@ class DropsTest < Test::Unit::TestCase
|
||||
def test_enumerable_drop_size
|
||||
assert_equal '3', Liquid::Template.parse( '{{collection.size}}').render('collection' => EnumerableDrop.new)
|
||||
end
|
||||
|
||||
def test_empty_string_value_access
|
||||
assert_equal '', Liquid::Template.parse('{{ product[value] }}').render('product' => ProductDrop.new, 'value' => '')
|
||||
end
|
||||
end # DropsTest
|
||||
|
||||
Reference in New Issue
Block a user