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
When creating an article or a subscription offer, we ask the admin for a price in decimal euros (5.00€), but we save it as cents in the DB (500). This avoids floating point errors when computing.
However because of this duality (form has a price but we save a price_cents), validation errors are hard to surface.
We could use Money and its Rails integration Money-Rails, to handle all the heavy lifting, validation...
The text was updated successfully, but these errors were encountered:
The gem seems to go way beyond what's needed, but I believe it's crucial for lea5 to be reliable as for money, therefore I support @nymous 's proposal.
When creating an article or a subscription offer, we ask the admin for a price in decimal euros (5.00€), but we save it as cents in the DB (500). This avoids floating point errors when computing.
However because of this duality (form has a
price
but we save aprice_cents
), validation errors are hard to surface.We could use Money and its Rails integration Money-Rails, to handle all the heavy lifting, validation...
The text was updated successfully, but these errors were encountered: