You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noticed an issue where in our system an edge case would cause the default currency of USD to get applied. Generally we want to be strict, and not risk a default value. When I attempted to set the default_currency to nil this started to error.
Based on this message I found while debugging [WARNING] The default currency will change from 'USD' to 'nil' in the next major release., it doesn't sound like it's intended to prevent the removal of a default.
I've prepared two PRs that make the required adjustments to allow nil to be used as a default value, that triggers NoCurrency error.
This will allow strictly defined systems to operate without risk of unexpected currencies.
The text was updated successfully, but these errors were encountered:
We would love to see this included as well. A default currency is a hard no for our use case. And just after installing the gem and setting up an object, I already stumbled about an issue which shows me why having a default could cause big problems.
classAccount < ApplicationRecordnormalizes:balance_currency,with: ->(currency){currency.strip.upcase}validates:balance,presence: true# to provide a Money object for the balance attributemonetize:balance,as: :moneyend
Noticed an issue where in our system an edge case would cause the default currency of USD to get applied. Generally we want to be strict, and not risk a default value. When I attempted to set the
default_currency
tonil
this started to error.Based on this message I found while debugging
[WARNING] The default currency will change from 'USD' to 'nil' in the next major release.
, it doesn't sound like it's intended to prevent the removal of a default.I've prepared two PRs that make the required adjustments to allow
nil
to be used as a default value, that triggersNoCurrency
error.This will allow strictly defined systems to operate without risk of unexpected currencies.
The text was updated successfully, but these errors were encountered: