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
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
defmodule Schedule do use Ash.Resource, data_layer: :embedded, extensions: [AshGraphql.Resource] graphql do type :schedule end attributes do attribute :count, :integer // ... end validations do validate numericality(:count, greater_than: 0) endend
defmodule Schedule do use Ash.Resource, data_layer: :embedded, extensions: [AshGraphql.Resource] graphql do type :schedule end attributes do attribute :count, :integer // ... end validations do validate numericality(:count, greater_than: 0) endend
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.