Hi,
how to validate existing records against changeset validations? Looking for best solution.
Imagine changing validation conditions and now i need to validate existing record in database using same validation rules. Ecto seems to run validations only on changes.
eg database has %User{name: "Joe"}
new validate length value name min: 5
def changeset(user, attrs) do
..
|> validate_length(:name, min: 5, max: 100)
end
User.changeset(user, %{}) says its valid
User.changeset(user, %{name: "Joe"}) says its valid