Ash.Resource.Validation.Builtins (ash v1.37.2) View Source
Built in validations that are available to all resources
The functions in this module are imported by default in the validations section.
Link to this section Summary
Functions
Validates the absence of a list of attributes
Validates that an attribute on the original record does not equal a specific value
Validates that an attribute on the original record equals a specific value
Validates that an attribute is being changed
Validates that a field or argument matches another field or argument
Validates that an attribute's value matches a given regex or string, using the provided error, message if not.
Validates that an attribute's value is in a given list
Validates the presence of a list of attributes
Validates that an attribute on the original record meets the given length criteria
Link to this section Functions
Validates the absence of a list of attributes
If no options are provided, validates that they are all absent.
The docs behave the same as present/2
, except they validate absence.
Validates that an attribute on the original record does not equal a specific value
Validates that an attribute on the original record equals a specific value
Validates that an attribute is being changed
Validates that a field or argument matches another field or argument
Validates that an attribute's value matches a given regex or string, using the provided error, message if not.
String.match?/2
is used to determine if it matches.
Validates that an attribute's value is in a given list
Validates the presence of a list of attributes
If no options are provided, validates that they are all present.
:at_least
- At least this many must be present. Defaults to the number of attributes provided:at_most
- At most this many must be present. Defaults to the number of attributes provided:exactly
- Exactly this many must be present
Validates that an attribute on the original record meets the given length criteria