Module: MongoMapper::Plugins::Callbacks

Defined in:
lib/mongo_mapper/plugins/callbacks.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: Callback, CallbackChain

Class Method Summary collapse

Class Method Details

.configure(model) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/mongo_mapper/plugins/callbacks.rb', line 7

def self.configure(model)
  model.class_eval do
    define_callbacks(
      :before_save,                 :after_save,
      :before_create,               :after_create,
      :before_update,               :after_update,
      :before_validation,           :after_validation,
      :before_validation_on_create, :after_validation_on_create,
      :before_validation_on_update, :after_validation_on_update,
      :before_destroy,              :after_destroy,
      :validate_on_create,          :validate_on_update,
      :validate
    )
  end
end