Skip to content
Browse files

Revert "reduce conditionals in url_for"

This reverts commit 9df6069.
  • Loading branch information...
1 parent 5478815 commit 3ccd24a33f3f9d6cad83181708e5aa11588b88b0 @tenderlove tenderlove committed May 12, 2014
Showing with 3 additions and 6 deletions.
  1. +3 −6 actionpack/lib/action_dispatch/routing/route_set.rb
View
9 actionpack/lib/action_dispatch/routing/route_set.rb
@@ -655,7 +655,7 @@ def url_for(options)
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 @@ def url_for(options)
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,

0 comments on commit 3ccd24a

Please sign in to comment.
Something went wrong with that request. Please try again.