Module: EfficientTranslations::TranslationFactory
- Defined in:
- lib/efficient_translations/translation_factory.rb
Class Method Summary collapse
Class Method Details
.build_translation_model(base_model) ⇒ Object
13 14 15 16 17 |
# File 'lib/efficient_translations/translation_factory.rb', line 13 def self.build_translation_model base_model klass = translation_model_for base_model klass.build_for base_model klass end |
.translation_model_for(model) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/efficient_translations/translation_factory.rb', line 3 def self.translation_model_for model if model.const_defined? :Translation model.const_get :Translation else translation = model.const_set :Translation, Class.new(ActiveRecord::Base) translation.send :include, TranslationModel translation end end |