module ActiveModel::Conversion::ClassMethods

def _to_partial_path # :nodoc:

:nodoc:
internal method and should not be accessed directly.
Provide a class level cache for #to_partial_path. This is an
:nodoc:
def _to_partial_path # :nodoc:
  @_to_partial_path ||= if respond_to?(:model_name)
    "#{model_name.collection}/#{model_name.element}"
  else
    element = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(name))
    collection = ActiveSupport::Inflector.tableize(name)
    "#{collection}/#{element}"
  end
end