class Marten::Schema::Field::Slug

Overview

Represents an slug schema field.

Defined in:

marten/schema/field.cr
marten/schema/field/slug.cr

Constructors

Instance Method Summary

Instance methods inherited from class Marten::Schema::Field::String

deserialize(value) : ::String | Nil deserialize, max_size : Int32? max_size, min_size : Int32? min_size, serialize(value) : ::String | Nil serialize, strip? : Bool strip?, validate(schema, value) validate

Constructor methods inherited from class Marten::Schema::Field::String

new(id : ::String, required : ::Bool = true, max_size : Int32 | Nil = nil, min_size : Int32 | Nil = nil, strip : ::Bool = true) new

Instance methods inherited from class Marten::Schema::Field::Base

deserialize(value) deserialize, empty_value?(value) : ::Bool empty_value?, id : String id, required? : Bool required?, serialize(value) : ::String | Nil serialize, validate(schema, value) validate

Constructor methods inherited from class Marten::Schema::Field::Base

new(id : ::String, required : ::Bool = true) new

Constructor Detail

def self.new(id : ::String, required : ::Bool = true, max_size : Int32 | Nil = 50, min_size : Int32 | Nil = nil, strip : ::Bool = true) #

[View source]

Instance Method Detail

def validate(schema, value) #
Description copied from class Marten::Schema::Field::Base

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

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


[View source]