Skip to content

Commit

Permalink
Fix non-public method warning in Module#delegate. Fixes #2548.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonleighton committed Aug 16, 2011
1 parent 2330c0c commit c238ba0
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -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
#
Expand Down

0 comments on commit c238ba0

Please sign in to comment.