Ecto.Changeset.validate_acceptance
You're seeing just the function
validate_acceptance
, go back to Ecto.Changeset module for more information.
Specs
Validates the given parameter is true.
Note this validation only checks the parameter itself is true, never
the field in the schema. That's because acceptance parameters do not need
to be persisted, as by definition they would always be stored as true
.
Options
:message
- the message on failure, defaults to "must be accepted"
Examples
validate_acceptance(changeset, :terms_of_service)
validate_acceptance(changeset, :rules, message: "please accept rules")