mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Remove unnecessary tag rule code
The applicator converts the input to an array, even `nil` becomes an empty array. Iterating over an empty array doesn't do anything either, the result is the same.
This commit is contained in:
@@ -14,8 +14,6 @@ module OpenFoodNetwork
|
||||
end
|
||||
|
||||
def filter!(subject)
|
||||
return unless subject.respond_to?(:any?) && subject.any?
|
||||
|
||||
subject.to_a.reject! do |element|
|
||||
if rule_class.respond_to?(:tagged_children_for)
|
||||
children = rule_class.tagged_children_for(element)
|
||||
|
||||
Reference in New Issue
Block a user