123456789_123456789_123456789_123456789_123456789_

Module: ActiveModel::Conversion::ClassMethods

Do not use. This module is for internal use only.
Relationships & Source Files
Defined in: activemodel/lib/active_model/conversion.rb

Instance Method Summary

Instance Method Details

#_to_partial_path

Provide a class level cache for ActiveModel::Conversion#to_partial_path. This is an internal method and should not be accessed directly.

[ GitHub ]

  
# File 'activemodel/lib/active_model/conversion.rb', line 110

def _to_partial_path # :nodoc:
  @_to_partial_path || ActiveSupport::Ractors.on_main(self) do
    @_to_partial_path ||= if respond_to?(:model_name)
      "#{model_name.collection}/#{model_name.element}".freeze
    else
      element = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(name))
      collection = ActiveSupport::Inflector.tableize(name)
      "#{collection}/#{element}".freeze
    end
  end
end