diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/polymorphic_routes.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/polymorphic_routes.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb index 3e2b21ac72..4f1aaeefc8 100644 --- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb @@ -134,7 +134,6 @@ module ActionDispatch opts end - %w(edit new).each do |action| module_eval <<-EOT, __FILE__, __LINE__ + 1 def #{action}_polymorphic_url(record_or_hash, options = {}) @@ -211,7 +210,6 @@ module ActionDispatch method, args = builder.handle_model record_or_hash_or_array end - if options.empty? recipient.send(method, *args) else @@ -250,9 +248,9 @@ module ActionDispatch named_route = if model.persisted? args << model get_method_for_string model.model_name.singular_route_key - else - get_method_for_class model - end + else + get_method_for_class model + end [named_route, args] end |