diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-01 16:17:45 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-12 15:54:42 -0700 |
commit | 6eeb76f0411e3d7d78b903601e15a7c7b61ed88b (patch) | |
tree | 65ac52c9562ce042f93b9f955a9a4df69b980192 /actionpack/lib | |
parent | f2fa291a63bac8126e61f126d5be5dfed2e4f6e6 (diff) | |
download | rails-6eeb76f0411e3d7d78b903601e15a7c7b61ed88b.tar.gz rails-6eeb76f0411e3d7d78b903601e15a7c7b61ed88b.tar.bz2 rails-6eeb76f0411e3d7d78b903601e15a7c7b61ed88b.zip |
skip another Array is_a check
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/polymorphic_routes.rb | 10 |
1 files changed, 6 insertions, 4 deletions
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 |