Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

only do the Array is_a check once

  • Loading branch information...
commit f2fa291a63bac8126e61f126d5be5dfed2e4f6e6 1 parent de1b9f8
@tenderlove tenderlove authored
Showing with 3 additions and 4 deletions.
  1. +3 −4 actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
View
7 actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
@@ -111,12 +111,11 @@ def polymorphic_url(record_or_hash_or_array, options = {})
if record_or_hash_or_array.first.is_a?(ActionDispatch::Routing::RoutesProxy)
recipient = record_or_hash_or_array.shift
end
+ args = record_or_hash_or_array.dup
+ else
+ args = [record_or_hash_or_array]
end
- args = Array === record_or_hash_or_array ?
- record_or_hash_or_array.dup :
- [ record_or_hash_or_array ]
-
record_list = extract_record_list(record_or_hash_or_array)
record = convert_to_model(record_list.pop)
Please sign in to comment.
Something went wrong with that request. Please try again.