Expand description
Active Record-style lifecycle callbacks.
A model implements Callbacks (all hooks default to no-op) and persists
through run_create/run_update/run_destroy, which fire the hooks in
Rails’ order around the supplied persistence step. A hook returning Err
aborts before the record is written.
Traits§
- Callbacks
- Lifecycle hooks fired around persistence. Override the ones you need.
Functions§
- run_
create - Insert:
before_validation → before_save → before_create → persist → after_create → after_save. - run_
destroy - Destroy:
before_destroy → persist → after_destroy. - run_
update - Update:
before_validation → before_save → before_update → persist → after_update → after_save.