moxley

moxley

Documentation for generic actions

I’m trying to understand how to define a generic action, following the documentation. A generic action has a run option that appears to be where the work is done. There is a code example available that shows what using run with an anonymous function looks like for a happy path. All good so far.

The documentation for the run option gives a type spec of (any, any -> any) | module | module. What is any, any, and any supposed to be? What does the module in the type spec need to define? There’s no explanation under the “Doc” for run.

At the top of the actions.action documentation, it says “For calling this action, see the Ash.Domain documentation.”. Following that link goes to a fairly sparse page that has no mention of custom actions.

Is there another place in the documentation that talks about generic actions in more detail?

Marked As Solved

barnabasJ

barnabasJ

Ash Core Team

Here is the behaviour you need to implement Ash.Resource.Actions.Implementation — ash v3.29.3

This should be referenced somewhere in the generic actions doc. If you’d like you could PR that.

The types should also clarify what the (any, any → any) should be. The anonymous function doesn’t take options.

Also Liked

zachdaniel

zachdaniel

Creator of Ash

We are aware, and this is the next major item on the docket. All reference documentation on every package will be gone over, including ensuring every function has typespecs, every option to every function is documented, and cross links exist to relevant guides etc.

barnabasJ

barnabasJ

Ash Core Team

The best thing to return there is either a built-in or custom exception.

But anything would potentially work and would be wrapped in an Ash.Error.Unknown exception.

moxley

moxley

If you’d like you could PR that.

I’ve contributed documentation PRs to Ash before.

I’ve been using Ash for over a year in production now. The documentation has been a major pain point the entire time, every step of the way.

Ash’s documentation has been really, really, REALLY frustrating. It’s hard to hide that frustration as I ask question after question about how to use Ash on this forum. I’ve never had to ask questions on a forum to understand a software tool before, let alone ask a continuous string of questions over the course of a year. I still find myself asking after all this time, “should I tear Ash out of my application?”.

Are the maintainers aware of this, or is it just too big of a problem to address in the foreseeable future?

If I submitted a PR every time I ran into clearly missing documentation, I’d be spending all my time on writing documentation for the Ash Framework rather than on the software I’m using it for.

Last Post!

moxley

moxley

Wonderful. That’s great to hear @zachdaniel! Thank you for providing this framework to the community.

Where Next?

Popular in Questions Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New

Other popular topics Top

nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement