Module: HasManyTranslations::Creation

Defined in:
lib/has_many_translations/creation.rb

Overview

Adds the functionality necessary for translation actions on a has_translations instance of ActiveRecord::Base.

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/has_many_translations/creation.rb', line 8

def self.included(base) # :nodoc:
  base.class_eval do
    extend ClassMethods
    include InstanceMethods
    before_update :update_translation?
    
    after_save :update_translations!
    class << self
      alias_method_chain :prepare_translated_options, :creation
    end
  end
end