aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-05-08 11:20:33 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-05-12 15:54:45 -0700
commit3095f5ba38a7c230d5732af0128d9ddd7142ff7f (patch)
treee443a57fc4fe67ec21c3c0e809af74eb24d71184 /actionpack/lib/action_dispatch
parente14ec1266cfc91b9ee23a75aa82baff9760d2c42 (diff)
downloadrails-3095f5ba38a7c230d5732af0128d9ddd7142ff7f.tar.gz
rails-3095f5ba38a7c230d5732af0128d9ddd7142ff7f.tar.bz2
rails-3095f5ba38a7c230d5732af0128d9ddd7142ff7f.zip
push string handling to the builder object
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/polymorphic_routes.rb18
1 files changed, 8 insertions, 10 deletions
diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
index a86896a232..9859b6907d 100644
--- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
+++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb
@@ -140,10 +140,9 @@ module ActionDispatch
method, args = builder.handle_model record, prefix, suffix
when String, Symbol
- method, args = handle_string record_or_hash_or_array,
- prefix,
- suffix,
- inflection
+ method, args = builder.handle_string record_or_hash_or_array,
+ prefix,
+ suffix
when Class
method, args = builder.handle_class record_or_hash_or_array,
prefix,
@@ -203,6 +202,11 @@ module ActionDispatch
@key_strategy = key_strategy
end
+ def handle_string(record, prefix, suffix)
+ method = prefix + "#{record}_#{suffix}"
+ [method, []]
+ end
+
def handle_class(klass, prefix, suffix)
name = @key_strategy.call klass.model_name
[prefix + "#{name}_#{suffix}", []]
@@ -268,12 +272,6 @@ module ActionDispatch
[named_route, args]
end
- def handle_string(record, prefix, suffix, inflection)
- args = []
- method = prefix + "#{record}_#{suffix}"
- [method, args]
- end
-
def model_path_helper_call(record)
handle_model record, ''.freeze, "path".freeze, ROUTE_KEY
end