Always validate constraints (#173)

This commit is contained in:
zimt28 2021-01-14 16:52:18 +01:00 committed by GitHub
parent 13ca0b2976
commit 2a7acffabb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -398,6 +398,8 @@ defmodule Ash.Type do
end
def apply_constraints(type, term, constraints) do
constraints = NimbleOptions.validate!(constraints, type.constraints())
case type.apply_constraints(term, constraints) do
:ok -> {:ok, term}
other -> other