1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Pass strings to demodulize method

Goes along with fea1cdcff4 and
59ec4562a2.
This commit is contained in:
Carlos Antonio da Silva 2014-02-26 21:20:33 -03:00
parent 8d8ea78a89
commit c20fe91b05

View file

@ -83,7 +83,7 @@ module ActiveModel
# internal method and should not be accessed directly.
def _to_partial_path #:nodoc:
@_to_partial_path ||= begin
element = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(self))
element = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(name))
collection = ActiveSupport::Inflector.tableize(name)
"#{collection}/#{element}".freeze
end