Method: MiniForm::Model.included

Defined in:
lib/mini_form/model.rb

.included(base) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/mini_form/model.rb', line 8

def self.included(base)
  base.class_eval do
    include ActiveModel::Validations
    include ActiveModel::Validations::Callbacks
    include ActiveModel::Conversion

    extend ActiveModel::Naming
    extend ActiveModel::Callbacks

    extend ClassMethods

    define_model_callbacks :update
    define_model_callbacks :assignment

    # For backwards compatibility purpose
    define_model_callbacks :assigment

    before_update :before_update
    after_update :after_update

    before_assignment :before_assignment
    after_assignment :after_assignment

    # For backwards compatibility purpose
    before_assigment :before_assigment
    after_assigment :after_assigment
  end
end