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_validationafter_validationbefore_savebefore_create(orbefore_updatefor update operations)after_create(orafter_updatefor update operations)after_saveafter_commit(orafter_rollbackwhen the transaction is rolled back)