MartenMoney::DB::Field::Money
Inherits Marten::DB::Field::Base < Reference < Object
Constructors
Class methods
Converts value into an Int64 amount of minor units for the generated amount field.
The exact amount is derived from Money#amount because Money#fractional silently drops
sub-minor-unit precision when Money.infinite_precision? is enabled. Values that cannot be
represented exactly as an Int64 raise an ArgumentError.
Instance methods
default
Returns nil to keep the virtual field out of Marten's default value initialization.
The generated amount and currency fields own the persisted defaults. The configured
default remains available as metadata through #money_default.
Extracts the field value from a DB result set and returns the right object corresponding to this value.