Ash Framework
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.
JoinAsh Framework
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.
JoinHow to write a policy to ensure the user belongs to the tenant through a membership relation?
Anonymous Function Queries (Preparations)
Loading data from an external API for a calculation
Flattening Polymorphic Relationships in Ash GraphQL
bankAccounts
, I get something like this:...Ash Auth For Inertia Setup & Ash Auth vs Ash Phoenix Auth
mix phx.gen.auth
in my Inertia setup and was wondering:
a) Am I losing anything if I don't use Ash Auth yet if I already has my auth configured from the phx.gen.auth since I can just pass the right scope for the actors when using Ash? I am migrating my models to Ash resources now but I need to understand how the ash auth works in tandem with the ash resources as a whole.
b) For the auth vs phoenix auth, I assume phoenix auth is just the UI/liveview + routes scope on top of the ash auth? I can still build my own routes with Inertia rendering and use the auth module to trigger the auth internally right?...ash_authentication_live_session dups
Ash.Scope
, it occurred to me that I'm sort of duplicating assignments with current_user
as it's also set via ash_authentication_live_session
. Is this generally just how folks do things for convenient access in the view or should I be deduplicating somehow? I feel like I shouldn't care but it bothers me on some level lol. Thanks!Cross schema many_to_many
TypedStruct with array and default
{:array, OtherStruct}
field. Passing data to new()
works as expected but after adding default: []
to the field, the field only returns []
. I'm not sure if this is a bug or intended.
Structs:
```...
Ash.Notifier
AshJsonApi: Can a domain support routes for different endpoints/routers?
Usage rules task not found
usage_rules
? I'm getting this all of a sudden: ** (Mix) The task "usage_rules.sync" could not be found
It's in a clean new project. After running ash.setup
, the next thing I always do before starting to work on the project is generating the AGENTS.md
file. Always worked fine until now...Having a small policy that doesn't seem to ever be called
case Map.get(context.actor || %{}, :group_id) do
which i would probably doAsh AI not working
Failed to JSON decode error response. ERROR: %Jason.DecodeError{position: 1005, token: nil, data: "{\n \"error\": {\n \"code\": 400,\n \"message\": \"Invalid JSON payload received. Unknown name \\\"additionalProperties\\\" at 'tools[0].function_declarations[0].parameters
Failed to JSON decode error response. ERROR: %Jason.DecodeError{position: 1005, token: nil, data: "{\n \"error\": {\n \"code\": 400,\n \"message\": \"Invalid JSON payload received. Unknown name \\\"additionalProperties\\\" at 'tools[0].function_declarations[0].parameters
Missing __spark_metadata__ field in Ash.Notifier.PubSub.Publication struct
__spark_metadata__
field. This field is required to access source annotations. Add __spark_metadata__: nil
to the defstruct for Ash.Notifier.PubSub.Publication.
(elixir 1.18.4) lib/enum.ex:987: Enum."-each/2-lists^foreach/1-0-"/2
(spark 2.3.4) lib/spark/dsl/extension.ex:2135: Spark.Dsl.Extension.after_verify/1...no function clause matching in Pgvector.new/1
Ash AI writeable error:
writable? false
spark warning on compilation
``
warning: Entity without __spark_metadata__ field is deprecated. Entity Reactor.Dsl.Middleware does not define a
spark_metadata field. This field is required to acces
s source annotations. Add
spark_metadata: nil` to the defstruct for Reactor.Dsl.Middleware.
(elixir 1.18.4) lib/enum.ex:987: Enum."-each/2-lists^foreach/1-0-"/2...usage rules req me to change igniter `only`
igniter
is not in prod but when i try to add usage rules via the expert LS it says that there's a version conflict.Composite primary keys vs through
destination/source_attribute_on_join_resource
both expect an atom. Is it possible to reference a composite key on a join table? I am trying to set up a many_to_many
relationship.Can I instruct Ash to force update a CiString value regardless of comparison result?
Ash.CiString
on a resource field (backed by postgres citext
) for all the uniqueness constraint validation goodness, but recently discovered that Ash is skipping updates to the field value when only the case has changed.
I know, I know: why am I using a CiString
if I don't want case-insensitive comparison? Because I don't want to clobber other records with the same case-insensitive name. But I do want to give the user control to update the casing of the value on an individual record. I have a NameCollissionPrevention
validation that ignores the current record in question when deciding if the record update is valid, so I don't think this is programmer error, it feels like Ash is ignoring the field in the update b/c it compares as equal.
Maybe CiString isn't the right tool for the job in this scenario. I'm curious if Ash provides a way to say "you can update this value to anything (and any case) you want". ...:name
arg isn't required:
```
change(fn changeset, _ctx ->
case changeset.arguments[:name] do...