Discussing the Lack of Built-in Multi-Field Validation in Ecto Changesets

154
clicks
Discussing the Lack of Built-in Multi-Field Validation in Ecto Changesets

Source: reddit.com

Type: Discussion

Emotional-Ad-1396, who is relatively new to Elixir, has encountered a challenge while working with Ecto, which is a part of the Elixir ecosystem for handling database interactions. The user expresses surprise at the apparent absence of straightforward support for cross-field validation within Ecto changesets, which are used for data validation and type casting. While Ecto does offer the `validate_change` function for single-field validation, Emotional-Ad-1396 expected to find a similar built-in function that can handle multiple fields. They are considering the option of creating a custom validation function, but are reaching out to the community for advice, hoping someone has already tackled this issue more efficiently.

© HashMerge 2024