Add Ecto Changeset validations
kipcole9 opened this issue · comments
Kip Cole commented
@DaTrader, @LostKobrakai, In commit cd2547d I have added Money.Validation.validate_money/3
that mirrors the way Ecto.Changeset.validate_number/3
operates.
Comments and suggestions welcome. Here is the draft changelog entry:
Enhancements
- Adds the module
Money.Validation
to provide Ecto Changeset validations. In particular it addsMoney.Validation.validate_money/3
which behaves exactly likeEcto.Changeset.validate_number/3
only fort:Money
types.
Kip Cole commented
I will add validate_money_amount/3
and validate_money_currency/3
over the next few days.