Module: ActiveRecordCompose::Callbacks

Extended by:
ActiveModel::Callbacks, ActiveSupport::Concern
Includes:
ActiveModel::Model, ActiveModel::Validations::Callbacks
Included in:
Model, Persistence
Defined in:
lib/active_record_compose/callbacks.rb,
sig/_internal/package_private.rbs

Overview

Provides hooks into the life cycle of an ActiveRecordCompose model, allowing you to insert custom logic before or after changes to the object's state.

The callback flow generally follows the same structure as Active Record:

  • before_validation
  • after_validation
  • before_save
  • before_create (or before_update for update operations)
  • after_create (or after_update for update operations)
  • after_save
  • after_commit (or after_rollback when the transaction is rolled back)