mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-28 22:55:12 -07:00
Merge pull request #1951 from Shopify/actual-revert
Fully revert calling to_s on filter array
This commit is contained in:
@@ -982,8 +982,6 @@ module Liquid
|
|||||||
|
|
||||||
return default_value if ary.empty?
|
return default_value if ary.empty?
|
||||||
|
|
||||||
property = Utils.to_s(property)
|
|
||||||
|
|
||||||
block.call(ary) do |item|
|
block.call(ary) do |item|
|
||||||
if target_value.nil?
|
if target_value.nil?
|
||||||
item[property]
|
item[property]
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Liquid
|
module Liquid
|
||||||
VERSION = "5.8.5"
|
VERSION = "5.8.6"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1054,10 +1054,11 @@ class StandardFiltersTest < Minitest::Test
|
|||||||
|
|
||||||
def test_where_with_nil_is_a_no_op
|
def test_where_with_nil_is_a_no_op
|
||||||
environment = { "array" => ["alpha", "beta", "gamma"] }
|
environment = { "array" => ["alpha", "beta", "gamma"] }
|
||||||
expected_output = "alpha beta gamma"
|
|
||||||
template = "{{ array | where: nil | join: ' ' }}"
|
template = "{{ array | where: nil | join: ' ' }}"
|
||||||
|
|
||||||
assert_template_result(expected_output, template, environment)
|
assert_raises(Liquid::ArgumentError) do
|
||||||
|
assert_template_result("alpha beta gamma", template, environment)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_where_with_value
|
def test_where_with_value
|
||||||
|
|||||||
Reference in New Issue
Block a user