Ash FrameworkAF
Ash Framework7mo ago
4 replies
Lēctia

newbie: incorrect code in AshPostgres examples?

https://hexdocs.pm/ash_postgres/get-started-with-ash-postgres.html#aggregates

the last example there is about loading aggregates on demand, and includes in particular:
representatives = Helpdesk.Support.read!(Helpdesk.Support.Representative)

which is confusing to me as well as the compiler. im new to ash and elixir but how would a domain have a read action? domains dont even take actions. the compiler says (UndefinedFunctionError) function Helpdesk.Support.read!/1 is undefined or private
Solution
Just to add that you can have code_interfaces on your domain, that have functions you can call. But in that case you won't need to pass the Resource. https://hexdocs.pm/ash/code-interfaces.html
Was this page helpful?