Module: ActiveRecord::Translation

Includes:
ActiveModel::Translation
Included in:
Base
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/translation.rb

Instance Method Summary collapse

Methods included from ActiveModel::Translation

#human_attribute_name

Methods included from ActiveModel::Naming

extended, #model_name, param_key, plural, route_key, singular, singular_route_key, uncountable?

Instance Method Details

#i18n_scopeObject

Set the i18n scope to override ActiveModel.



20
21
22
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/translation.rb', line 20

def i18n_scope # :nodoc:
  :activerecord
end

#lookup_ancestorsObject

Set the lookup ancestors for ActiveModel.



8
9
10
11
12
13
14
15
16
17
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/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