diff options
author | Hiroshi Saito <hiroshi3110@gmail.com> | 2008-11-16 17:51:39 +0900 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-19 12:07:12 +0100 |
commit | 291d199de1271c254c44b94766d13013b222a125 (patch) | |
tree | b13420a09e248961cdabe0d61d42f050691c17b9 /actionpack/lib/action_controller | |
parent | f451f0e5cfa358e88ac9d03d813a9c84facd6648 (diff) | |
download | rails-291d199de1271c254c44b94766d13013b222a125.tar.gz rails-291d199de1271c254c44b94766d13013b222a125.tar.bz2 rails-291d199de1271c254c44b94766d13013b222a125.zip |
Let polymorphic_path treat an array contains single name as without array [#1386 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/polymorphic_routes.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/polymorphic_routes.rb b/actionpack/lib/action_controller/polymorphic_routes.rb index 2644c7f7c7..28722c93ca 100644 --- a/actionpack/lib/action_controller/polymorphic_routes.rb +++ b/actionpack/lib/action_controller/polymorphic_routes.rb @@ -74,6 +74,7 @@ module ActionController def polymorphic_url(record_or_hash_or_array, options = {}) if record_or_hash_or_array.kind_of?(Array) record_or_hash_or_array = record_or_hash_or_array.compact + 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) |