diff options
-rw-r--r-- | actionpack/lib/action_dispatch/routing/polymorphic_routes.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb index 7b97bf0157..1a4adcbb35 100644 --- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb @@ -114,7 +114,6 @@ module ActionDispatch recipient = record_or_hash_or_array.shift end - args = record_or_hash_or_array.dup record_list = record_or_hash_or_array.dup when Hash unless record_or_hash_or_array[:id] @@ -122,17 +121,14 @@ module ActionDispatch end opts = record_or_hash_or_array.dup.merge!(opts) - args = [opts.delete(:id)] - record_list = args.dup + record_list = [opts.delete(:id)] when nil raise ArgumentError, "Nil location provided. Can't build URI." else - args = [record_or_hash_or_array] record_list = [record_or_hash_or_array] end - record = record_list.pop inflection = lambda { |name| name.singular_route_key } |