diff options
-rw-r--r-- | actionpack/lib/action_dispatch/routing/polymorphic_routes.rb | 6 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 9 |
2 files changed, 7 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb index 1c44d25ef6..984ded1ff5 100644 --- a/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +++ b/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb @@ -104,7 +104,7 @@ module ActionDispatch end if mapping = polymorphic_mapping(record_or_hash_or_array) - return mapping.call(self, [record_or_hash_or_array], options) + return mapping.call(self, [record_or_hash_or_array, options]) end opts = options.dup @@ -128,7 +128,7 @@ module ActionDispatch end if mapping = polymorphic_mapping(record_or_hash_or_array) - return mapping.call(self, [record_or_hash_or_array], options, only_path: true) + return mapping.call(self, [record_or_hash_or_array, options], only_path: true) end opts = options.dup @@ -273,7 +273,7 @@ module ActionDispatch def handle_model_call(target, record) if mapping = polymorphic_mapping(target, record) - mapping.call(target, [record], {}, only_path: suffix == "path") + mapping.call(target, [record], only_path: suffix == "path") else method, args = handle_model(record) target.send(method, *args) diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 832f6f12ab..a2e5351697 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -164,15 +164,13 @@ module ActionDispatch @path_helpers_module.module_eval do define_method(:"#{name}_path") do |*args| - options = args.extract_options! - helper.call(self, args, options, only_path: true) + helper.call(self, args, only_path: true) end end @url_helpers_module.module_eval do define_method(:"#{name}_url") do |*args| - options = args.extract_options! - helper.call(self, args, options) + helper.call(self, args) end end end @@ -621,7 +619,8 @@ module ActionDispatch @block = block end - def call(t, args, options, outer_options = {}) + def call(t, args, outer_options = {}) + options = args.extract_options! url_options = eval_block(t, args, options) case url_options |