williamgueiros / Brcpfcnpj

Validação,Formatação e Gerador Cpf/Cnpj em Elixir
MIT License
69 stars 17 forks source link

Make validate remove previous errors on the field, if any #41

Open fmbraga opened 2 years ago

fmbraga commented 2 years ago

Solves #40

The PR will remove field from :errors, and adjust :valid? accordingly

VitorTrin commented 2 years ago

The code you changed is stolen from validate_change (https://github.com/elixir-ecto/ecto/blob/960725b9e0719c79d8296c4852072780e8d5cc3e/lib/ecto/changeset.ex#L1711-L1715). Can you provide an example that shows this isn't the expected behaviour for changeset validations?