Marten::DB::Field::ManyToOne
Inherits Marten::DB::Field::Base / Reference / Object
Constructors
Instance methods
from_db(value) : Marten::DB::Field::ReferenceDBTypes
Converts the raw DB value to the corresponding field value.
Extracts the field value from a DB result set and returns the right object corresponding to this value.
on_delete
Sourcerelation?
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).
relation_name
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).