Apply the same fix for find_index and has

This commit is contained in:
Guilherme Carreiro
2025-01-24 08:39:01 +01:00
committed by Guilherme Carreiro
parent 5718c4cee2
commit bf1419b8ac
3 changed files with 36 additions and 3 deletions
+2 -2
View File
@@ -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