Permalink
Browse files

make I18n::Backend::Base a module instead of a class. should make it …

…easier to overwrite methods in Base from included modules
  • Loading branch information...
1 parent 4d2b9d2 commit f44faeb241c4813d222f4c25b2c648ef065be320 Sven Fuchs committed Nov 13, 2009
@@ -3,7 +3,9 @@
module I18n
module Backend
- class ActiveRecord < Base
+ class ActiveRecord
+ include Base
+
def reload!
end
@@ -8,7 +8,7 @@
# was extracted from the original backend.
module I18n
module Backend
- class ActiveRecord < Base
+ class ActiveRecord
module StoreProcs
class << self
def included(target)
@@ -43,7 +43,7 @@ module Backend
# :value => lambda { |key, options| 'FOO' }
# Translation.find_by_locale_and_key('en', 'foo').value
# # => 'FOO'
- class ActiveRecord < Base
+ class ActiveRecord
class Translation < ::ActiveRecord::Base
set_table_name 'translations'
attr_protected :is_proc
@@ -5,7 +5,7 @@
module I18n
module Backend
- class Base
+ module Base
include I18n::Backend::Helpers
RESERVED_KEYS = [:scope, :default, :separator]
@@ -233,4 +233,4 @@ def merge_translations(locale, data)
end
end
end
-end
+end
@@ -16,7 +16,7 @@ module Backend
#
# The implementation assumes that all backends added to the Chain implement
# a lookup method with the same API as Simple backend does.
- class Chain < Base
+ class Chain < Simple
attr_accessor :backends
def initialize(*backends)
@@ -61,4 +61,4 @@ def lookup(locale, key, scope = [], separator = nil)
end
end
end
-end
+end
@@ -17,7 +17,8 @@
module I18n
module Backend
- class Simple < Base
+ class Simple
+ include Base
end
end
-end
+end

0 comments on commit f44faeb

Please sign in to comment.