Skip to content
Browse files

Use #include? instead of #any?, make it simpler

  • Loading branch information...
1 parent 2b6e305 commit c1e3a8c389245e8b85f4c7df216af3a51205a0f3 @akshay-vishnoi akshay-vishnoi committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
View
2 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

0 comments on commit c1e3a8c

Please sign in to comment.
Something went wrong with that request. Please try again.