aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext')
-rw-r--r--activesupport/lib/active_support/core_ext/module/delegation.rb4
1 files changed, 3 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 d78cecc390..db6aea9b87 100644
--- a/activesupport/lib/active_support/core_ext/module/delegation.rb
+++ b/activesupport/lib/active_support/core_ext/module/delegation.rb
@@ -1,3 +1,5 @@
+require "active_support/core_ext/module/remove_method"
+
class Module
# Provides a delegate class method to easily expose contained objects' methods
# as your own. Pass one or more methods (specified as symbols or strings)
@@ -121,7 +123,7 @@ class Module
module_eval(<<-EOS, file, line)
if instance_methods(false).map(&:to_s).include?("#{prefix}#{method}")
- remove_method("#{prefix}#{method}")
+ remove_possible_method("#{prefix}#{method}")
end
def #{prefix}#{method}(*args, &block) # def customer_name(*args, &block)