mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 13:33:20 +12:00
docs: add additional docs for validations
This commit is contained in:
parent
e730158bcd
commit
e1ac4150a9
1 changed files with 14 additions and 1 deletions
|
@ -84,4 +84,17 @@ validations do
|
||||||
where present(:baz)
|
where present(:baz)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Action-Specific Validation
|
||||||
|
|
||||||
|
You can also put a validation directly in an action, like so:
|
||||||
|
|
||||||
|
```elixir
|
||||||
|
actions do
|
||||||
|
create do
|
||||||
|
...
|
||||||
|
validate present([:foo, :bar], at_least: 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in a new issue