mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
0d3effc97e
"Overwrite" means "destructively replace", and is more suitable when, for example, talking about writing data to a location. "Override" means "supersede", and is more suitable when, for example, talking about redifining methods in a subclass.
24 lines
514 B
Ruby
24 lines
514 B
Ruby
# frozen_string_literal: true
|
|
|
|
module ActiveRecord
|
|
module Translation
|
|
include ActiveModel::Translation
|
|
|
|
# Set the lookup ancestors for ActiveModel.
|
|
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
|
|
|
|
# Set the i18n scope to override ActiveModel.
|
|
def i18n_scope # :nodoc:
|
|
:activerecord
|
|
end
|
|
end
|
|
end
|