From f87888066a7280430fd48f7b76bf63d31dbce81a Mon Sep 17 00:00:00 2001 From: Ben Orenstein Date: Wed, 8 Jun 2011 23:05:43 -0400 Subject: [PATCH] Simplify boolean logic into ternary. --- activesupport/lib/active_support/core_ext/module/delegation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb index 3a7652f5bf..1777a4b32d 100644 --- a/activesupport/lib/active_support/core_ext/module/delegation.rb +++ b/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 -- GitLab