diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-12-15 20:07:41 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-12-15 20:45:37 +0000 |
commit | ceb33f84933639d3b61aac62e5e71fd087ab65ed (patch) | |
tree | 1b8fcb8f19d37c5faa0a4d63dd52d369fbaad5b1 /activerecord/lib/active_record/translation.rb | |
parent | 8854bf29a3590771aa989eb7e4b79f31eba9d96d (diff) | |
download | rails-ceb33f84933639d3b61aac62e5e71fd087ab65ed.tar.gz rails-ceb33f84933639d3b61aac62e5e71fd087ab65ed.tar.bz2 rails-ceb33f84933639d3b61aac62e5e71fd087ab65ed.zip |
Split out most of the AR::Base code into separate modules :cake:
Diffstat (limited to 'activerecord/lib/active_record/translation.rb')
-rw-r--r-- | activerecord/lib/active_record/translation.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/translation.rb b/activerecord/lib/active_record/translation.rb new file mode 100644 index 0000000000..ddcb5f2a7a --- /dev/null +++ b/activerecord/lib/active_record/translation.rb @@ -0,0 +1,22 @@ +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 != klass.base_class + classes << klass = klass.superclass + end + classes + end + + # Set the i18n scope to overwrite ActiveModel. + def i18n_scope #:nodoc: + :activerecord + end + end +end |