From 6eeb76f0411e3d7d78b903601e15a7c7b61ed88b Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 1 May 2014 16:17:45 -0700 Subject: skip another Array is_a check --- actionpack/lib/action_dispatch/routing/polymorphic_routes.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_dispatch/routing/polymorphic_routes.rb') diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb index d8108e5534..b749ae0825 100644 --- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb @@ -111,12 +111,15 @@ module ActionDispatch 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 + + args = record_or_hash_or_array.dup + record_list = record_or_hash_or_array.dup else - args = [record_or_hash_or_array] + + args = [record_or_hash_or_array] + record_list = extract_record_list(record_or_hash_or_array) end - record_list = extract_record_list(record_or_hash_or_array) record = convert_to_model(record_list.pop) inflection = if options[:action] && options[:action].to_s == "new" @@ -201,7 +204,6 @@ module ActionDispatch def extract_record_list(record_or_hash_or_array) case record_or_hash_or_array - when Array; record_or_hash_or_array when Hash; [record_or_hash_or_array[:id]].compact else [record_or_hash_or_array] end -- cgit v1.2.3