Permalink
Browse files

reduce blank? checks

  • Loading branch information...
1 parent ddda5e7 commit f0eff10c090a56ea28201341361439dfbc31485b @tenderlove tenderlove committed May 28, 2014
Showing with 9 additions and 4 deletions.
  1. +9 −4 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -260,14 +260,19 @@ def default_controller_and_action
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

0 comments on commit f0eff10

Please sign in to comment.