Skip to content
Browse files

Fix non-public method warning in Module#delegate. Fixes #2548.

  • Loading branch information...
1 parent 2330c0c commit c238ba00a8865ed0ea1b200a940f39e983fb0e98 @jonleighton jonleighton committed Aug 16, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 activesupport/lib/active_support/core_ext/module/delegation.rb
View
7 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
#

0 comments on commit c238ba0

Please sign in to comment.
Something went wrong with that request. Please try again.