diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-07-26 17:49:19 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:19 -0700 |
commit | ed09aef1a3566ac987f883d743ad1ef773a87ac2 (patch) | |
tree | 143ecbd6279f7671a1f94d8005f5225298010d84 /actionpack | |
parent | a704fd4ea9b8ac86f57d357bd8e2a555b69edca9 (diff) | |
download | rails-ed09aef1a3566ac987f883d743ad1ef773a87ac2.tar.gz rails-ed09aef1a3566ac987f883d743ad1ef773a87ac2.tar.bz2 rails-ed09aef1a3566ac987f883d743ad1ef773a87ac2.zip |
simplify conditionals by assuming hash values will never be `false`
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 187e2a8a74..53374949ae 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -224,19 +224,11 @@ module ActionDispatch end def default_controller - if @options[:controller] - @options[:controller] - elsif @scope[:controller] - @scope[:controller] - end + @options[:controller] || @scope[:controller] end def default_action - if @options[:action] - @options[:action] - elsif @scope[:action] - @scope[:action] - end + @options[:action] || @scope[:action] end end |