From c238ba00a8865ed0ea1b200a940f39e983fb0e98 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Tue, 16 Aug 2011 22:27:07 +0100 Subject: [PATCH] Fix non-public method warning in Module#delegate. Fixes #2548. --- .../lib/active_support/core_ext/module/delegation.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/activesupport/lib/active_support/core_ext/module/delegation.rb b/activesupport/lib/active_support/core_ext/module/delegation.rb index 11d257efb66c3..e696c866da98f 100644 --- a/activesupport/lib/active_support/core_ext/module/delegation.rb +++ b/activesupport/lib/active_support/core_ext/module/delegation.rb @@ -145,9 +145,10 @@ def #{prefix}#{method}(*args, &block) # def cu klass = to.singleton_methods.any? ? to.singleton_class : to.class # klass = to.singleton_methods.any? ? to.singleton_class : to.class unless klass.public_method_defined?(#{method.inspect}) # unless klass.public_method_defined?(:name) ActiveSupport::Deprecation.warn( # ActiveSupport::Deprecation.warn( - "Using Module#delegate to delegate to non-public methods is " \ # "..." \ - "deprecated. Please declare your methods as public if they " \ # "..." \ - "are going to accessed from other classes." # "..." + "Using Module#delegate to delegate to non-public methods is " + # "..." + + "deprecated. Please declare your methods as public if they " + # "..." + + "are going to accessed from other classes.", # "...", + [#{"#{file}:#{line}".inspect}] # ["app/models/firm.rb:16"] ) # ) end # end #