From a3b89261525f0c4caf72208117a8ab91ede676a0 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 1 May 2014 13:56:55 -0700 Subject: remove extract_record since we have extracted the list --- .../lib/action_dispatch/routing/polymorphic_routes.rb | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb index 074eb8a59c..4d83b48ad1 100644 --- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb @@ -114,10 +114,8 @@ module ActionDispatch record_or_hash_or_array = record_or_hash_or_array[0] if record_or_hash_or_array.size == 1 end - record = extract_record(record_or_hash_or_array) - record = convert_to_model(record) - record_list = extract_record_list(record_or_hash_or_array) + record = convert_to_model(record_list.last) args = Array === record_or_hash_or_array ? record_or_hash_or_array.dup : @@ -133,7 +131,6 @@ module ActionDispatch args.pop :plural elsif record.is_a?(Hash) - record_list = [] :singular else :singular @@ -207,14 +204,6 @@ module ActionDispatch action_prefix(options) + route.join("_") end - def extract_record(record_or_hash_or_array) - case record_or_hash_or_array - when Array; record_or_hash_or_array.last - when Hash; record_or_hash_or_array[:id] - else record_or_hash_or_array - end - end - def extract_record_list(record_or_hash_or_array) case record_or_hash_or_array when Array; record_or_hash_or_array -- cgit v1.2.3