dmitriid
AEAsh Elixir
•Created by dmitriid on 4/10/2023 in #support
protocol Enumerable not implemented for #Ash.Changeset
I apologize if I abuse the support channel, please tell me if I should take this to #general or #archive-debugging
I've ran into this issue on two different resources, and I'll detail both below. The tl;dr is: I define a
code_interface
for a resource, but when I call the function it fails with protocol Enumerable not implemented for #Ash.Changeset<action_type: :create...
at (ash 2.6.27) lib/ash/changeset/changeset.ex:998: Ash.Changeset.cast_params/3
Resource the first
I want to generate an "external id" on creation, so I expose a new
acton via code_interface.
Then calling it:
I'll continue with the second resource in the comments11 replies
AEAsh Elixir
•Created by dmitriid on 4/7/2023 in #support
Lookups/calcultions based on has_many relationships
I will try to be very precise and concise, so apologies if this comes off rude-ish.
- The history table contains a long list of entires that a user enters the application. Imagine like a list of chat entries.
- The users can bookmark any number of those history entries
- when retrieving a list of entries (e.g., last 40 entries, or all entries in a paged manner) I would like to try and in one go retrieve both the entries and whether they were bookmarked by this particular user
A corresponding SQL query would be something like
I have it sort of figured out with relationships and calculations, but this seems to load more data than I would actually like.
Relevant parts only:
And the bookmarks:
Continued below
27 replies