I know there is a configuration for BigDecimal: BigDecimal.mode(BigDecimal::EXCEPTION_ZERODIVIDE, true).
That seems to have no effect on this: Money.new(1) / Money.new(0)
In addition, I would prefer to not have to change the behaviour of BigDecimal, as I don't know what other libraries might depend on that configuration. I would prefer to make the change at the money gem level.
Is there a way to prevent division by zero?
I know there is a configuration for BigDecimal:
BigDecimal.mode(BigDecimal::EXCEPTION_ZERODIVIDE, true)
.That seems to have no effect on this:
Money.new(1) / Money.new(0)
In addition, I would prefer to not have to change the behaviour of BigDecimal, as I don't know what other libraries might depend on that configuration. I would prefer to make the change at the money gem level.