| Class | ActiveSupport::ModelName |
| In: |
vendor/rails/activesupport/lib/active_support/core_ext/module/model_naming.rb
|
| Parent: | String |
| collection | -> | cache_key |
| collection | [R] | |
| element | [R] | |
| partial_path | [R] | |
| plural | [R] | |
| singular | [R] |
# 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