miguels
AEAsh Elixir
•Created by miguels on 9/27/2023 in #support
Persist embedded resources as :text instead of :map
In my app I'm using Cocktail (https://hexdocs.pm/cocktail) to manage scheduled events which I'd like to save to a text field using
Cocktail.Schedule.to_i_calendar/1
.
What I have so far:
I use an embedded schema to generate the API used in LV forms and GraphQL
Which I use in another resource
And then realized that embedded schemas are persisted as maps and I haven't found a way to change this behaviour
I've also briefly tried setting up a custom type instead without much success.13 replies
AEAsh Elixir
•Created by miguels on 5/3/2023 in #support
Users getting logged out every few hours
I recently switched our auth from
phx.gen.auth
to AshAuthentication.
The switch was very smooth and users didn't notice anything except for one detail: they're now getting logged out every few hours (exact time seems to vary).
I've been going through all documentation and the Discord but haven't found anything related. The only thing I found was this option token_lifetime
, changing the value hasn't helped so far, though.
Any ideas what could be happening or were I can start debugging?8 replies
AEAsh Elixir
•Created by miguels on 4/23/2023 in #support
How to create has_one relationships in a nested form
I have a resource called
Transaction
that has a has_one
relationship with a resource called RecurrencePattern
. When creating a new transaction (usually through a form in LV) I want to also create a matching recurrence_pattern. This works great when using the create
action directly, but I'm getting an error when using an AshPhoenix.Form
(I believe I got it to work at some point but don't know how to get back there again 😅 )
This works:
This gives me an error:
The error inside the changeset:
42 replies