aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/polymorphic_routes.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-10-02 05:32:14 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-10-02 05:32:14 +0000
commit0ee1cb2cd32bfaf47deaf5440dd5b9cf0915ab6a (patch)
tree5778378eafcbdfa37c82c67be1566c76aca249be /actionpack/lib/action_controller/polymorphic_routes.rb
parent9264bdc8f618344307f07790a07a60dc04b80434 (diff)
downloadrails-0ee1cb2cd32bfaf47deaf5440dd5b9cf0915ab6a.tar.gz
rails-0ee1cb2cd32bfaf47deaf5440dd5b9cf0915ab6a.tar.bz2
rails-0ee1cb2cd32bfaf47deaf5440dd5b9cf0915ab6a.zip
Ruby 1.9 compat, consistent load paths
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7719 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/polymorphic_routes.rb')
-rw-r--r--actionpack/lib/action_controller/polymorphic_routes.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/polymorphic_routes.rb b/actionpack/lib/action_controller/polymorphic_routes.rb
index 2e048dfceb..94aefc9aae 100644
--- a/actionpack/lib/action_controller/polymorphic_routes.rb
+++ b/actionpack/lib/action_controller/polymorphic_routes.rb
@@ -6,8 +6,8 @@ module ActionController
namespace = extract_namespace(record_or_hash_or_array)
args = case record_or_hash_or_array
- when Hash: [ record_or_hash_or_array ]
- when Array: record_or_hash_or_array.dup
+ when Hash; [ record_or_hash_or_array ]
+ when Array; record_or_hash_or_array.dup
else [ record_or_hash_or_array ]
end
@@ -24,7 +24,7 @@ module ActionController
end
named_route = build_named_route_call(record_or_hash_or_array, namespace, inflection, options)
- send(named_route, *args)
+ send!(named_route, *args)
end
def polymorphic_path(record_or_hash_or_array)
@@ -55,10 +55,10 @@ module ActionController
def build_named_route_call(records, namespace, inflection, options = {})
records = Array.new([extract_record(records)]) unless records.is_a?(Array)
- base_segment = "#{RecordIdentifier.send("#{inflection}_class_name", records.pop)}_"
+ base_segment = "#{RecordIdentifier.send!("#{inflection}_class_name", records.pop)}_"
method_root = records.reverse.inject(base_segment) do |string, name|
- segment = "#{RecordIdentifier.send("singular_class_name", name)}_"
+ segment = "#{RecordIdentifier.send!("singular_class_name", name)}_"
segment << string
end
@@ -67,8 +67,8 @@ module ActionController
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]
+ when Array; record_or_hash_or_array.last
+ when Hash; record_or_hash_or_array[:id]
else record_or_hash_or_array
end
end
@@ -85,4 +85,4 @@ module ActionController
end
end
end
-end \ No newline at end of file
+end