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.
JoinIgniter messes with sourceror
mix igniter.install ash_authentication --auth-strategy magic_link
, however that fails after setting up igniter
with:
```...How to show embedded resource in Ash Admin
Is there a guide for bringing Ash into an existing phx.gen.auth app?
Manually sign in a user in Phoenix
GenerateTokenChange
and borrowing the magic link signin strategy I got my action to work
```diff
create :sign_up_with_invitation do
argument :token, :string, allow_nil?: false
...Deeply nested forms
Question on Multitenancy.
multitenancy
macro and belongs to :organization
to all resources?
2. I noticed we have functions like Ash.Query.set_tenant
for read and Ash.Changeset.set_tenant
for create. So I don't need to add something like change manage_relationship(:organization_id, :organization, type: :append)
for create action?...How to pass `opts` to Repo module functions?
opts = [settings: [final: 1]]
Repo.get(User, id, opts)
opts = [settings: [final: 1]]
Repo.get(User, id, opts)
Adding new create action produces error in resource schema
Container
, Image
and ImageCredentials
. Container
has a belongs_to
relationship with Image
, Image
has a has_many
relationship with Container
and a belongs_to
relationship with ImageCredentials
, while this last one has a has_many
relationship with it.
Container
has a create action (:create_with_nested
), with the purpose of creating a new Image
in case of a failed match or lookup. I'm fairly new to Ash, and I tried to add the same logic to Image
if it cannot match or lookup a ImageCredentials
by adding the following :create_with_nested
action to Image
:
```ex
create :create_with_nested do...How do I do this SQL UPDATE-query in Ash?
UPDATE hats SET activation_token = null, activated = NOW() WHERE activation_token = ...
UPDATE hats SET activation_token = null, activated = NOW() WHERE activation_token = ...
Return resource A from an action on resource B
User
resource and an Invitation
resource. I would like to create an :accept_invitation
action which validates an invitation record, creates a user, and returns the user. This is what I have attempted so far:
```elixir
on the invitation resource
update :create_user_with_invitation do...How to properly handle relationships and references
references do
reference :team, on_delete: :delete
reference :ticket, on_delete: :delete
end
references do
reference :team, on_delete: :delete
reference :ticket, on_delete: :delete
end
JSON API patch without bulk update
bulk_update
? I'm wanting to write an update policy that's essentially a runtime policy (i.e. it needs access to the object that's changing in order to validate). Poking around source code though, it looks like PATCHes are always implemented with bulk updates?Conditional Relationship Creation
manage_relationship/4
with type: :direct_control
and it does create the profile, but if the user already has one - with more data fulfilled - it overwrites it with the partial available data at user registration — which is not ideal.
Is manage_relationship/4
the right way to handle this? Or should I use an after_action hook to conditionally create the profile?...I found possible bug with Ash.DataLayer.Mnesia in form validation
How to implement an override table?
Manual relationship in belongs_to
belongs_to
-like and some are has_*
-like. And would love to preserve the semantics....How to concatenate strings on related column like STRING_AGG with sort?
has_many :parts, Part
has_many :parts, Part
Idiomatic way to test AshOban trigger conditions
Use full text search in fields