mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-02 16:45:12 -07:00
Fix another drop call regression
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ module Liquid
|
|||||||
|
|
||||||
# called by liquid to invoke a drop
|
# called by liquid to invoke a drop
|
||||||
def invoke_drop(method_or_key)
|
def invoke_drop(method_or_key)
|
||||||
if method_or_key != '' && self.class.public_method_defined?(method_or_key.to_s.to_sym)
|
if method_or_key && method_or_key != '' && self.class.public_method_defined?(method_or_key.to_s.to_sym)
|
||||||
send(method_or_key.to_s.to_sym)
|
send(method_or_key.to_s.to_sym)
|
||||||
else
|
else
|
||||||
before_method(method_or_key)
|
before_method(method_or_key)
|
||||||
|
|||||||
@@ -159,4 +159,8 @@ class DropsTest < Test::Unit::TestCase
|
|||||||
def test_empty_string_value_access
|
def test_empty_string_value_access
|
||||||
assert_equal '', Liquid::Template.parse('{{ product[value] }}').render('product' => ProductDrop.new, 'value' => '')
|
assert_equal '', Liquid::Template.parse('{{ product[value] }}').render('product' => ProductDrop.new, 'value' => '')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_nil_value_access
|
||||||
|
assert_equal '', Liquid::Template.parse('{{ product[value] }}').render('product' => ProductDrop.new, 'value' => nil)
|
||||||
|
end
|
||||||
end # DropsTest
|
end # DropsTest
|
||||||
|
|||||||
Reference in New Issue
Block a user