From f0eff10c090a56ea28201341361439dfbc31485b Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 28 May 2014 15:38:11 -0700 Subject: reduce blank? checks --- actionpack/lib/action_dispatch/routing/mapper.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index e0b725c8f2..565609542a 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -260,14 +260,19 @@ module ActionDispatch end end - controller = controller.to_s unless controller.is_a?(Regexp) + hash = {} + action = action.to_s unless action.is_a?(Regexp) + if controller.is_a? Regexp + hash[:controller] = controller + else + check_controller! controller.to_s + hash[:controller] = controller.to_s if controller + end + check_action! action - check_controller! controller - hash = {} - hash[:controller] = controller unless controller.blank? hash[:action] = action unless action.blank? hash end -- cgit v1.2.3