aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorDaniel Schierbeck <daniel.schierbeck@gmail.com>2008-09-21 15:29:32 +0200
committerMichael Koziarski <michael@koziarski.com>2008-10-19 13:42:57 +0200
commitde0ed534f6055c365d05c685582edeceef1eafa6 (patch)
tree94a2e6bee30d3c059d05441075ba49276ff8bfcf /activesupport
parent32a58d2afc18c1ab6cb5a8b9fbd0ff981d7a714a (diff)
downloadrails-de0ed534f6055c365d05c685582edeceef1eafa6.tar.gz
rails-de0ed534f6055c365d05c685582edeceef1eafa6.tar.bz2
rails-de0ed534f6055c365d05c685582edeceef1eafa6.zip
Simplified the implementation of the :prefix option.
Signed-off-by: Michael Koziarski <michael@koziarski.com> [#984 state:committed]
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/module/delegation.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb
index c457569b9a..1ad18402e5 100644
--- a/activesupport/lib/active_support/core_ext/module/delegation.rb
+++ b/activesupport/lib/active_support/core_ext/module/delegation.rb
@@ -78,7 +78,7 @@ class Module
raise ArgumentError, "Delegation needs a target. Supply an options hash with a :to key as the last argument (e.g. delegate :hello, :to => :greeter)."
end
- prefix = options[:prefix] && (options[:prefix] == true ? "#{to}_" : "#{options[:prefix]}_")
+ prefix = options[:prefix] && "#{options[:prefix] == true ? to : options[:prefix]}_"
methods.each do |method|
module_eval(<<-EOS, "(__DELEGATION__)", 1)