aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAndrew White <andrew.white@unboxed.co>2017-02-21 12:57:08 +0000
committerAndrew White <andrew.white@unboxed.co>2017-02-21 15:30:47 +0000
commitfbda6b9837e3ce41dc59de0e791c972ba6d49ba3 (patch)
tree04ea650951977e54664f4873f8684cb9bca96e0e /actionpack
parentef862c04e5cc4deed04e0ffc70af88431803efe6 (diff)
downloadrails-fbda6b9837e3ce41dc59de0e791c972ba6d49ba3.tar.gz
rails-fbda6b9837e3ce41dc59de0e791c972ba6d49ba3.tar.bz2
rails-fbda6b9837e3ce41dc59de0e791c972ba6d49ba3.zip
Push option extract into call method
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/routing/polymorphic_routes.rb6
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb9
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