diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-07-26 17:49:19 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-07-26 17:49:47 -0700 |
commit | 0b987042bf611330609304a22465d0f30f026076 (patch) | |
tree | 5e1c8d59a4bd06fa1cd53da89fe82a0b98ff1e6f /actionpack/lib | |
parent | 7868cf8a655ede2003c00ce3a1351da2a01cae5c (diff) | |
download | rails-0b987042bf611330609304a22465d0f30f026076.tar.gz rails-0b987042bf611330609304a22465d0f30f026076.tar.bz2 rails-0b987042bf611330609304a22465d0f30f026076.zip |
simplify conditionals by assuming hash values will never be `false`
Diffstat (limited to 'actionpack/lib')
-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 |