From 9df60693d77813b362fb528fc62381ac8f1eec12 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <aaron.patterson@gmail.com>
Date: Mon, 12 May 2014 11:58:12 -0700
Subject: reduce conditionals in url_for

---
 actionpack/lib/action_dispatch/routing/route_set.rb | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index d61b430f68..cc31c4306f 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,8 +668,11 @@ module ActionDispatch
         RESERVED_OPTIONS.each { |ro| path_options.delete ro }
         path_options = yield(path_options) if block_given?
 
-        path, params = generate(path_options, recall || {})
-        params.merge!(options[:params] || {})
+        path, params = generate(path_options, recall)
+
+        if options.key? :params
+          params.merge! options[:params]
+        end
 
         ActionDispatch::Http::URL.url_for(options.merge!({
           :path => path,
-- 
cgit v1.2.3