diff options
author | Daniel Schierbeck <daniel.schierbeck@gmail.com> | 2008-09-21 15:29:32 +0200 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-10-19 13:42:57 +0200 |
commit | de0ed534f6055c365d05c685582edeceef1eafa6 (patch) | |
tree | 94a2e6bee30d3c059d05441075ba49276ff8bfcf | |
parent | 32a58d2afc18c1ab6cb5a8b9fbd0ff981d7a714a (diff) | |
download | rails-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]
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/delegation.rb | 2 |
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) |