mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-12 23:40:45 -07:00
Apply the same fix for find_index and has
This commit is contained in:
committed by
Guilherme Carreiro
parent
5718c4cee2
commit
bf1419b8ac
@@ -459,7 +459,7 @@ module Liquid
|
||||
# @liquid_syntax array | some: string, string
|
||||
# @liquid_return [boolean]
|
||||
def has(input, property, target_value = nil)
|
||||
filter_array(input, property, target_value) { |ary, &block| ary.any?(&block) }
|
||||
filter_array(input, property, target_value, false) { |ary, &block| ary.any?(&block) }
|
||||
end
|
||||
|
||||
# @liquid_public_docs
|
||||
@@ -485,7 +485,7 @@ module Liquid
|
||||
# @liquid_syntax array | find_index: string, string
|
||||
# @liquid_return [number]
|
||||
def find_index(input, property, target_value = nil)
|
||||
filter_array(input, property, target_value) { |ary, &block| ary.find_index(&block) }
|
||||
filter_array(input, property, target_value, nil) { |ary, &block| ary.find_index(&block) }
|
||||
end
|
||||
|
||||
# @liquid_public_docs
|
||||
|
||||
Reference in New Issue
Block a user