Skip to content

Commit

Permalink
simplify conditionals by assuming hash values will never be false
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove authored and fxn committed Aug 13, 2011
1 parent a704fd4 commit ed09aef
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions actionpack/lib/action_dispatch/routing/mapper.rb
Expand Up @@ -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

Expand Down

0 comments on commit ed09aef

Please sign in to comment.