Skip to content
This repository
Browse code

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

  • Loading branch information...
commit c238ba00a8865ed0ea1b200a940f39e983fb0e98 1 parent 2330c0c
Jon Leighton jonleighton authored
7 activesupport/lib/active_support/core_ext/module/delegation.rb
@@ -145,9 +145,10 @@ def #{prefix}#{method}(*args, &block) # def cu
145 145 klass = to.singleton_methods.any? ? to.singleton_class : to.class # klass = to.singleton_methods.any? ? to.singleton_class : to.class
146 146 unless klass.public_method_defined?(#{method.inspect}) # unless klass.public_method_defined?(:name)
147 147 ActiveSupport::Deprecation.warn( # ActiveSupport::Deprecation.warn(
148   - "Using Module#delegate to delegate to non-public methods is " \ # "..." \
149   - "deprecated. Please declare your methods as public if they " \ # "..." \
150   - "are going to accessed from other classes." # "..."
  148 + "Using Module#delegate to delegate to non-public methods is " + # "..." +
  149 + "deprecated. Please declare your methods as public if they " + # "..." +
  150 + "are going to accessed from other classes.", # "...",
  151 + [#{"#{file}:#{line}".inspect}] # ["app/models/firm.rb:16"]
151 152 ) # )
152 153 end # end
153 154 #

0 comments on commit c238ba0

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