1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

_recall should be set to a hash or not set

Then we can avoid nil checks
This commit is contained in:
Aaron Patterson 2014-05-13 17:21:55 -07:00
parent 760aa3b52b
commit 348af15c33
2 changed files with 4 additions and 4 deletions

View file

@ -656,7 +656,7 @@ module ActionDispatch
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 @@ module ActionDispatch
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!({

View file

@ -320,8 +320,8 @@ module ActionDispatch
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