Module: Globalize::Model::ActiveRecord::Translated::InstanceMethods
- Defined in:
- lib/batch_translation.rb
Instance Method Summary collapse
- #after_save ⇒ Object
-
#init_translations ⇒ Object
Builds an empty translation for each available locale not in use after creation.
Instance Method Details
#after_save ⇒ Object
31 32 33 |
# File 'lib/batch_translation.rb', line 31 def after_save init_translations end |
#init_translations ⇒ Object
Builds an empty translation for each available locale not in use after creation
36 37 38 39 40 41 42 43 44 |
# File 'lib/batch_translation.rb', line 36 def init_translations I18n.translated_locales.reject{|key| key == :root }.each do |locale| translation = self.translations.find_by_locale locale.to_s if translation.nil? translations.build :locale => locale save end end end |