diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb index cbc4c9d65ee83..b800ee64489d1 100644 --- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb @@ -104,7 +104,7 @@ def polymorphic_url(record_or_hash_or_array, options = {}) recipient = self if record_or_hash_or_array.kind_of?(Array) - if record_or_hash_or_array.any?(&:nil?) + if record_or_hash_or_array.include? nil raise ArgumentError, "Nil location provided. Can't build URI." end record_or_hash_or_array = record_or_hash_or_array.dup