docs: Fix constraints example in enum how_to (#51)

The Code Snippet gave me a compile error, telling me that `one_of` was not a valid options
This commit is contained in:
Barnabas Jovanovics 2023-01-17 15:40:33 +01:00 committed by GitHub
parent c0f5f596cb
commit cf4dd38e39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,9 @@ Enums are implemented automatically for any `atom` *attribute* (not arguments) w
```elixir
# On the resource of type `:ticket`
attribute :type, :atom, one_of: [:foo, :bar, :baz]
attribute :type, :atom do
constraints one_of: [:foo, :bar, :baz]
end
```
This would produce an enum called `:ticket_type`/`TicketType`.