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.
Join--install igniter option clarification
--install foo,bar --install baz,quux equivalent to --install foo,bar,baz,quux?Enforce each item is unique in attribute array
[:en, :en] .
```...Use policies to limit allowed values of Enum in create action
what is the possiblity that ash code gen does not generate migration
newbie: incorrect code in AshPostgres examples?
How to access property of a join resource in filter?
filter, how do I select only those related resources whose boolean is true or false in the join_through resource?parent() expression is for https://hexdocs.pm/ash/expressions.html#many-to-many-relationships. I didn't know I had to give a custom name to my join_relationship or otherwise use the default _join_assoc name when accessing this fielderror in creating new project
Custom queries in migration
Potential bug with relationship `parent` references
parent in relationship filters. My setup looks something like this:
1. A resource called GuideLevel with a has_many relationship with no_attributes? true and a filter. This relationship is called ancestors and uses an AshPostgres.Ltree column to get the ancestors of the current record, although idt the ltree behavior is relevant to the bug. The filter expression looks like: filter expr(fragment("? @> ? AND ? < ?", level, parent(level), nlevel, parent(nlevel))). Note that this references an nlevel calculation which just calculates the nlevel of the ltree column: calculate :nlevel, :integer, expr(fragment("nlevel(?)", level))...Testing `Ash.Resource.Change` in Isolation
Ash.Resource.Change and it's occurring to me it shouldn't be too difficult to test those modules in isolation.
If I have an Ash.Resource.Change that just runs an after_transaction hook, how do I trigger that function directly?...Accept subset of Ash.Type.Enum in action
Ash.Type.Enum defined as
```elixir
defmodule Dreng.Accounts.Role do
use Ash.Type.Enum, values: [:superadmin, :admin, :farmer, :farmhand]
end...Update Params in Nested Form with Union type
Ash.Error.Unknown.UnknownError: Invalid reference
UserUpload resource. I added another criteria for filtering the resource by the first or last name of its user relationship. However, the String.contains? lines give this error:
11:29:38.679 request_id=GFIrFgeBN9WstPIAASCB remote_ip=127.0.0.1 [error] ** (MatchError) no match of right hand side value: {:error, %Ash.Error.Unknown{errors: [%Ash.Error.Unknown.UnknownError{error: "Invalid reference user.first_name at relationship_path [:user]", field: nil, value: nil, splode: Ash.Error, bread_crumbs: [], vars: [], path: [:filter], stacktrace: #Splode.Stacktrace<>, class: :unknown}]}}
11:29:38.679 request_id=GFIrFgeBN9WstPIAASCB remote_ip=127.0.0.1 [error] ** (MatchError) no match of right hand side value: {:error, %Ash.Error.Unknown{errors: [%Ash.Error.Unknown.UnknownError{error: "Invalid reference user.first_name at relationship_path [:user]", field: nil, value: nil, splode: Ash.Error, bread_crumbs: [], vars: [], path: [:filter], stacktrace: #Splode.Stacktrace<>, class: :unknown}]}}
first_name and last_name fields are public?: true...
Advise on using policies with related resources
Transfer and Account. Transfer updates the accounts balance it's related to.
Now I have admin which can create/update/read both resources.
I have an operator that can only create transfers.
The issue is updating the account balance when the operator creates the transfer. Since he does not have access to create/update an acccount....AshCommanded - I'm running in to an issue with ash_commanded not working with spark v3?
How to set the actor within an action
user as an argument:
```
create :upsert_meeting_prep_action do...Subscriptions do not work when declared in the domain.
Plug.CSRFProtection.InvalidCSRFTokenError
Rollback went further than expected
mix ash.rollback -r Ngen.Repo and answered the prompt but it rolled much further back than I expected.
```bash
How many migrations should be rolled back? (default: 0)
...Persisting values from relationships at creation time
products to be purchased by users. Since prices might change over time, I'd like to put the price of the product at the time of purchase into the order resource record.
Given a product with the following attributes...