Sha256: 6309e478f5c410d09bbfbfeb345f8eb016bb5c503c0a476edfda83576c83e6d7

Contents?: true

Size: 642 Bytes

Versions: 5

Compression:

Stored size: 642 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc:
  module Callbacks
    extend ActiveSupport::Concern

    CALLBACKS = [
      :before_validation, :after_validation,
      :after_initialize,
      :before_create, :around_create, :after_create,
      :before_destroy, :around_destroy, :after_destroy,
      :before_save, :around_save, :after_save,
      :before_update, :around_update, :after_update,
    ]

    included do
      extend ActiveModel::Callbacks
      include ActiveModel::Validations::Callbacks

      define_model_callbacks :initialize, :only => :after
      define_model_callbacks :create, :destroy, :save, :update
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
mongoid-braxton-2.0.2 lib/mongoid/callbacks.rb
mongoid-2.0.2 lib/mongoid/callbacks.rb
mongoid-2.0.1 lib/mongoid/callbacks.rb
mongoid-2.0.0 lib/mongoid/callbacks.rb
mongoid-2.0.0.rc.8 lib/mongoid/callbacks.rb