aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/module/delegation.rb
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-03-16 23:24:00 -0700
committerwycats <wycats@gmail.com>2010-03-16 23:24:00 -0700
commitcd9ffd11e13ef6e62eba2cbd5c3760ff04132820 (patch)
tree0fcc940424e1265f03d5df623f324cf7ca310dd3 /activesupport/lib/active_support/core_ext/module/delegation.rb
parentc7388124153e1b1f85965998e5d1c20eed670da8 (diff)
downloadrails-cd9ffd11e13ef6e62eba2cbd5c3760ff04132820.tar.gz
rails-cd9ffd11e13ef6e62eba2cbd5c3760ff04132820.tar.bz2
rails-cd9ffd11e13ef6e62eba2cbd5c3760ff04132820.zip
Eliminate warnings for AM on 1.8
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module/delegation.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/module/delegation.rb6
1 files changed, 5 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 df8aefea5a..d78cecc390 100644
--- a/activesupport/lib/active_support/core_ext/module/delegation.rb
+++ b/activesupport/lib/active_support/core_ext/module/delegation.rb
@@ -34,7 +34,7 @@ class Module
# class Foo
# CONSTANT_ARRAY = [0,1,2,3]
# @@class_array = [4,5,6,7]
- #
+ #
# def initialize
# @instance_array = [8,9,10,11]
# end
@@ -120,6 +120,10 @@ class Module
end
module_eval(<<-EOS, file, line)
+ if instance_methods(false).map(&:to_s).include?("#{prefix}#{method}")
+ remove_method("#{prefix}#{method}")
+ end
+
def #{prefix}#{method}(*args, &block) # def customer_name(*args, &block)
#{to}.__send__(#{method.inspect}, *args, &block) # client.__send__(:name, *args, &block)
rescue NoMethodError # rescue NoMethodError