Class ActiveSupport::ModelName
In: vendor/rails/activesupport/lib/active_support/core_ext/module/model_naming.rb
Parent: String

Methods

new  

External Aliases

collection -> cache_key

Attributes

collection  [R] 
element  [R] 
partial_path  [R] 
plural  [R] 
singular  [R] 

Public Class methods

[Source]

    # File vendor/rails/activesupport/lib/active_support/core_ext/module/model_naming.rb, line 6
 6:     def initialize(name)
 7:       super
 8:       @singular = ActiveSupport::Inflector.underscore(self).tr('/', '_').freeze
 9:       @plural = ActiveSupport::Inflector.pluralize(@singular).freeze
10:       @element = ActiveSupport::Inflector.underscore(ActiveSupport::Inflector.demodulize(self)).freeze
11:       @collection = ActiveSupport::Inflector.tableize(self).freeze
12:       @partial_path = "#{@collection}/#{@element}".freeze
13:     end

[Validate]