aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-05-28 15:46:00 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-05-28 15:46:00 -0700
commitc99d28f1f223e87523559f071eca2d84ac41f14c (patch)
treefbaa793f052e9fce21e4bb67ee47752cb5563d90 /actionpack/lib/action_dispatch
parentf0eff10c090a56ea28201341361439dfbc31485b (diff)
downloadrails-c99d28f1f223e87523559f071eca2d84ac41f14c.tar.gz
rails-c99d28f1f223e87523559f071eca2d84ac41f14c.tar.bz2
rails-c99d28f1f223e87523559f071eca2d84ac41f14c.zip
reduce action.blank? calls
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 565609542a..178728ea2a 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -262,8 +262,6 @@ module ActionDispatch
hash = {}
- action = action.to_s unless action.is_a?(Regexp)
-
if controller.is_a? Regexp
hash[:controller] = controller
else
@@ -271,9 +269,13 @@ module ActionDispatch
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