class

Marten::DB::Field::Text

Inherits Marten::DB::Field::Base / Reference / Object

Constructors

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

Instance methods

default

Returns the default value of the field if any.

Source
empty_value?(value) : ::Bool

Returns true if the value is considered empty by the field.

Source
from_db(value) : ::String | Nil

Converts the raw DB value to the corresponding field value.

Source
from_db_result_set(result_set : ::DB::ResultSet) : ::String | Nil

Extracts the field value from a DB result set and returns the right object corresponding to this value.

Source
max_size
Source
to_column

Returns a migration column object corresponding to the field at hand.

Source
to_db(value) : ::DB::Any

Converts the field value to the corresponding DB value.

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