Unless legacy_default_currency! is used, models can't be validated if currency is missing. Calling valid? on the method will read all attributes and so it will end up calling Helpers.value_to_currency(currency) with nil currency which will raise in absence of defaults.
Only if both value and currency are null (and coerce_null is false), the validation can be performed as read_money_attribute will return early if value is nil.
Unless
legacy_default_currency!is used, models can't be validated if currency is missing. Callingvalid?on the method will read all attributes and so it will end up callingHelpers.value_to_currency(currency)withnilcurrency which will raise in absence of defaults.Only if both value and currency are null (and coerce_null is false), the validation can be performed as
read_money_attributewill return early if value is nil.