Module Mongoid::Callbacks
In: lib/mongoid/callbacks.rb

This module contains all the callback hooks for Mongoid.

Methods

Included Modules

ActiveModel::Validations::Callbacks

Constants

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, ]

Public Instance methods

Run the callbacks for the document. This overrides active support‘s functionality to cascade callbacks to embedded documents that have been flagged as such.

@example Run the callbacks.

  run_callbacks :save do
    save!
  end

@param [ Symbol ] kind The type of callback to execute. @param [ Array ] *args Any options.

@return [ Document ] The document

@since 2.3.0

[Validate]