Skip to content
Browse files

reduce action.blank? calls

  • Loading branch information...
1 parent f0eff10 commit c99d28f1f223e87523559f071eca2d84ac41f14c @tenderlove tenderlove committed May 28, 2014
Showing with 6 additions and 4 deletions.
  1. +6 −4 actionpack/lib/action_dispatch/routing/mapper.rb
View
10 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -262,18 +262,20 @@ def default_controller_and_action
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
+ if action.is_a? Regexp
+ hash[:action] = action
+ else
+ check_action! action.to_s
+ hash[:action] = action.to_s if action
+ end
- hash[:action] = action unless action.blank?
hash
end
end

0 comments on commit c99d28f

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