module Marten::DB::Model::Callbacks

Overview

Provides the ability to define model callbacks.

This module provides the ability to define callbacks that are executed before and / or after specific model record operations (ie. initialization, creation, update, save, and deletion).

Direct including types

Defined in:

marten/db/model/callbacks.cr

Macro Summary

Macro Detail

macro after_create(*names) #

Allows to do define callbacks that are called after creating a model record.


[View source]
macro after_delete(*names) #

Allows to do define callbacks that are called after deleting a model record.


[View source]
macro after_initialize(*names) #

Allows to do define callbacks that are called after initializing a model record.


[View source]
macro after_save(*names) #

Allows to do define callbacks that are called after saving a model record (creation or update).


[View source]
macro after_update(*names) #

Allows to do define callbacks that are called after updating a model record.


[View source]
macro before_create(*names) #

Allows to do define callbacks that are called before creating a model record.


[View source]
macro before_delete(*names) #

Allows to do define callbacks that are called before deleting a model record.


[View source]
macro before_save(*names) #

Allows to do define callbacks that are called before saving a model record (creation or update).


[View source]
macro before_update(*names) #

Allows to do define callbacks that are called before updating a model record.


[View source]