Permalink
Browse files

simplify conditionals by assuming hash values will never be `false`

  • Loading branch information...
tenderlove authored and fxn committed Jul 27, 2011
1 parent a704fd4 commit ed09aef1a3566ac987f883d743ad1ef773a87ac2
Showing with 2 additions and 10 deletions.
  1. +2 −10 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -224,19 +224,11 @@ def to
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

0 comments on commit ed09aef

Please sign in to comment.