Returns a boolean indicating whether the field is a primary key.
Marten::DB::Field::Base
Abstract base field implementation.
Constructors
Instance methods
Extracts the field value from a DB result set and returns the right object corresponding to this value.
Returns true if true should be returned for getter?-like methods for the field.
Usually, true would be returned for values that are truthy and not empty, but this logic can be overridden
on a per-field implementation basis.
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.
Returns true if the field is a relation.
By default this method will always return false. It should be overriden if the field is intended to handle
a relation with another model (eg. like many to one or one to one fields).
Returns the name of the relation on the model associated with the field.
This method will raise a NotImplementedError exception by default and should only be overriden if the
#relation? method returns true (this is the case for fields such as many to one, one to one, etc).
Returns a boolean indicating whether the field value should be unique throughout the associated table.
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.