module ActiveModel::Naming

def self.model_name_from_record_or_class(record_or_class)

def self.model_name_from_record_or_class(record_or_class)
  (record_or_class.is_a?(Class) ? record_or_class : record_or_class.class).model_name
end

def self.plural(record_or_class)

ActiveModel::Naming.plural(Highrise::Person) # => "highrise_people"
ActiveModel::Naming.plural(post) # => "posts"

Returns the plural class name of a record or class. Examples:
def self.plural(record_or_class)
  model_name_from_record_or_class(record_or_class).plural
end

def self.singular(record_or_class)

ActiveModel::Naming.singular(Highrise::Person) # => "highrise_person"
ActiveModel::Naming.singular(post) # => "post"

Returns the singular class name of a record or class. Examples:
def self.singular(record_or_class)
  model_name_from_record_or_class(record_or_class).singular
end

def self.uncountable?(record_or_class)

ActiveModel::Naming.uncountable?(Post) => false
ActiveModel::Naming.uncountable?(Sheep) # => true

Identifies whether the class name of a record or class is uncountable. Examples:
def self.uncountable?(record_or_class)
  plural(record_or_class) == singular(record_or_class)
end

def model_name

used to retrieve all kinds of naming-related information.
Returns an ActiveModel::Name object for module. It can be
def model_name
  @_model_name ||= ActiveModel::Name.new(self)
end