kipcole9 / money_sql

Money functions for the serialization of a money data type in Elixir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Ecto Changeset validations

kipcole9 opened this issue · comments

@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 adds Money.Validation.validate_money/3 which behaves exactly like Ecto.Changeset.validate_number/3 only for t:Money types.

I will add validate_money_amount/3 and validate_money_currency/3 over the next few days.