From 3ccd24a33f3f9d6cad83181708e5aa11588b88b0 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 12 May 2014 16:20:52 -0700 Subject: Revert "reduce conditionals in url_for" This reverts commit 9df60693d77813b362fb528fc62381ac8f1eec12. --- actionpack/lib/action_dispatch/routing/route_set.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index cc31c4306f..d61b430f68 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -655,7 +655,7 @@ module ActionDispatch options = default_url_options.merge(options || {}) user, password = extract_authentication(options) - recall = options.delete(:_recall) { {} } + recall = options.delete(:_recall) original_script_name = options.delete(:original_script_name).presence script_name = options.delete(:script_name).presence || _generate_prefix(options) @@ -668,11 +668,8 @@ module ActionDispatch RESERVED_OPTIONS.each { |ro| path_options.delete ro } path_options = yield(path_options) if block_given? - path, params = generate(path_options, recall) - - if options.key? :params - params.merge! options[:params] - end + path, params = generate(path_options, recall || {}) + params.merge!(options[:params] || {}) ActionDispatch::Http::URL.url_for(options.merge!({ :path => path, -- cgit v1.2.3