Permalink
Browse files

_recall should be set to a hash or not set

Then we can avoid nil checks
  • Loading branch information...
1 parent 760aa3b commit 348af15c3353e771c662638baeff02f1ae91e5d9 @tenderlove tenderlove committed May 14, 2014
Showing with 4 additions and 4 deletions.
  1. +2 −2 actionpack/lib/action_dispatch/routing/route_set.rb
  2. +2 −2 actionpack/test/abstract_unit.rb
@@ -656,7 +656,7 @@ def url_for(options)
password = options.delete :password
end
- recall = options.delete(:_recall)
+ recall = options.delete(:_recall) { {} }
original_script_name = options.delete(:original_script_name)
script_name = find_script_name options
@@ -668,7 +668,7 @@ def url_for(options)
path_options = options.dup
RESERVED_OPTIONS.each { |ro| path_options.delete ro }
- path, params = generate(path_options, recall || {})
+ path, params = generate(path_options, recall)
params.merge!(options[:params] || {})
ActionDispatch::Http::URL.url_for(options.merge!({
@@ -320,8 +320,8 @@ def get(uri_or_host, path = nil)
end
module RoutingTestHelpers
- def url_for(set, options, recall = nil)
- set.send(:url_for, options.merge(:only_path => true, :_recall => recall))
+ def url_for(set, options, recall = {})
+ set.url_for options.merge(:only_path => true, :_recall => recall)
end
end

0 comments on commit 348af15

Please sign in to comment.