diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-01 13:56:55 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-12 15:54:42 -0700 |
commit | a3b89261525f0c4caf72208117a8ab91ede676a0 (patch) | |
tree | 263c78c0a0353f6f61c80f5aab72f50bee4bad22 | |
parent | e937df389c7c9297d221fbb3dd49f87a134869f5 (diff) | |
download | rails-a3b89261525f0c4caf72208117a8ab91ede676a0.tar.gz rails-a3b89261525f0c4caf72208117a8ab91ede676a0.tar.bz2 rails-a3b89261525f0c4caf72208117a8ab91ede676a0.zip |
remove extract_record since we have extracted the list
-rw-r--r-- | actionpack/lib/action_dispatch/routing/polymorphic_routes.rb | 13 |
1 files changed, 1 insertions, 12 deletions
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 |