Represents an enum field.
Constructors
new(id : ::
String, enum_values :
Array(::
String), primary_key = false, blank = false, null = false, unique = false, index = false, db_column = nil, default : ::
Enum |
Nil = nil, **kwargs)
SourceInstance methods
default
Returns the default value of the field if any.
Sourcefrom_db(value) : ::
String |
Nil Converts the raw DB value to the corresponding field value.
SourceExtracts the field value from a DB result set and returns the right object corresponding to this value.
Sourceto_column
Returns a migration column object corresponding to the field at hand.
SourceConverts the field value to the corresponding DB value.
Source