Skip to content
Browse files

Simplify boolean logic into ternary.

  • Loading branch information...
1 parent 54b0aeb commit f87888066a7280430fd48f7b76bf63d31dbce81a @r00k r00k committed Jun 8, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/core_ext/module/delegation.rb
View
2 activesupport/lib/active_support/core_ext/module/delegation.rb
@@ -113,7 +113,7 @@ def delegate(*methods)
raise ArgumentError, "Can only automatically set the delegation prefix when delegating to a method."
end
- prefix = options[:prefix] && "#{options[:prefix] == true ? to : options[:prefix]}_" || ''
+ prefix = options[:prefix] ? "#{options[:prefix] == true ? to : options[:prefix]}_" : ''
file, line = caller.first.split(':', 2)
line = line.to_i

0 comments on commit f878880

Please sign in to comment.
Something went wrong with that request. Please try again.