class

Marten::DB::Field::Slug

Inherits Marten::Core::Sluggable / Marten::DB::Field::String / Marten::DB::Field::Base / Reference / Object

Represents a slug field.

Constructors

new(id : ::String, max_size : Int32 = 50, primary_key = false, default : ::String | Nil = nil, blank = false, null = false, unique = false, index = true, db_column = nil, slugify : Symbol | Nil = nil)
Source

Instance methods

prepare_save(record, new_record = false)

Runs pre-save logic for the specific field and record at hand.

This method does nothing by default but can be overridden for specific fields that need to set values on the model instance before save or perform any pre-save logic.

Source
validate(record, value)

Runs custom validation logic for a specific model field and model object.

This method should be overriden for each field implementation that requires custom validation logic.

Source

Macros

check_definition(field_id, kwargs)
Source