123456789_123456789_123456789_123456789_123456789_

Module: ActiveRecord::Translation

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Extended In:
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
Defined in: activerecord/lib/active_record/translation.rb

Constant Summary

::ActiveModel::Translation - Included

MISSING_TRANSLATION

Instance Method Summary

::ActiveModel::Translation - Included

#human_attribute_name

Transforms attribute names into a more human format, such as “First name” instead of “first_name”.

#i18n_scope

Returns the i18n_scope for the class.

#lookup_ancestors

When localizing a string, it goes through the lookup returned by this method, which is used in ActiveModel::Name#human, ActiveModel::Errors#full_messages and ActiveModel::Translation#human_attribute_name.

::ActiveModel::Naming - Included

#model_name

Returns an ::ActiveModel::Name object for module.

#inherited

Instance Method Details

#i18n_scope

This method is for internal use only.

Set the i18n scope to override ::ActiveModel.

[ GitHub ]

  
# File 'activerecord/lib/active_record/translation.rb', line 20

def i18n_scope # :nodoc:
  :activerecord
end

#lookup_ancestors

This method is for internal use only.

Set the lookup ancestors for ::ActiveModel.

[ GitHub ]

  
# File 'activerecord/lib/active_record/translation.rb', line 8

def lookup_ancestors # :nodoc:
  klass = self
  classes = [klass]
  return classes if klass == ActiveRecord::Base

  while !klass.base_class?
    classes << klass = klass.superclass
  end
  classes
end