Hi Rebecca.
I hope, I am not stupid this time 
On Chapter 6 page 142 Assigning Roles to Users is this code example:
attributes do
# ...
attribute :role, :atom do
allow_nil? false
default :user
constraints [one_of: [:admin, :editor, :user]]
end
end
when inserting constraints [one_of: [:admin, :editor, :user]] into my code, I get an compile error:
== Compilation error in file lib/tunez/accounts/user.ex ==
** (Spark.Error.DslError) [Tunez.Accounts.User]
attributes -> attribute -> role:
unknown options [:one_of], valid options are: []
(ash 3.4.62) /Volumes/Quizzlab/Projects/tunez/deps/spark/lib/spark/dsl/extension.ex:1187: Ash.Resource.Dsl.Attributes.Attribute.__build__/3
(spark 2.2.45) lib/spark/dsl/extension/entity.ex:91: Spark.Dsl.Extension.Entity.handle/6
lib/tunez/accounts/user.ex:284: (module)
I looked at your GitHub-repo, but the constraints-code is missing there.
I looked into the Hex-Docs:
action :priority, :integer do
constraints [min: 1, max: 3]
argument :status, :atom, constraints: [one_of: [:high, :medium, :low]]
and thought: okay that’s the typo, tried:
constraints: [one_of: [:admin, :editor, :user]]
and got:
== Compilation error in file lib/tunez/accounts/user.ex ==
** (SyntaxError) invalid syntax found on lib/tunez/accounts/user.ex:288:54:
error: unexpectedly reached end of line. The current expression is invalid or incomplete
│
288 │ constraints: [one_of: [:admin, :editor, :user]]
│ ^
│
└─ lib/tunez/accounts/user.ex:288:54
(elixir 1.18.1) lib/kernel/parallel_compiler.ex:428: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/8
Can you help me?
Just as I posted this message, I think, I found the solution.
The code:
attribute :role, Tunez.Accounts.Role do
allow_nil? false
default :user
end
does
constraints [one_of: [:admin, :editor, :user]]
automatically, because of the attribute:
attribute :role, Tunez.Accounts.Role
right?
Maybe this could be clarified.
Best wishes to you from Heiko