The values for greater_than_or_equal_to and less_than_or_equal_to refer to the normalized raw value, not to the value in cents. This is not documented, which can cause some confusion, as it did with me.
Another point is that nil values are converted to 0. In cases where the money cannot be nil, but nil is assigned to it, wouldn't it be better to add an error like "Value can't be blank"?
If these suggestions make sense, I can document them.
In the monetize below:
The values for
greater_than_or_equal_to
andless_than_or_equal_to
refer to the normalized raw value, not to the value in cents. This is not documented, which can cause some confusion, as it did with me.Another point is that nil values are converted to 0. In cases where the money cannot be nil, but nil is assigned to it, wouldn't it be better to add an error like "Value can't be blank"?
If these suggestions make sense, I can document them.