AF
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.
JoinAF
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 Authentication in Phoenix Liveviews
I am trying to implement the authentication in liveviews. can anyone provide me a helpful link?
AshAuthentication - How to alter page templates?
I was testing the new ash authentication extension (still in beta!). Although it is mentioned in docs that templates can be altered but couldn't find anything pointing to it. What is the quickest way to alter the design of the pages? like adding fields and new links, changing logo from Ash to something in text?
Row Level Permissions
Hi, I’m trying to return certain attributes only for some user roles aka implementing row level permissions. Currently I’m doing that with an prepare/after_action block and while that works, it doesn’t feel natural. Filters and checks don’t help and removing attributes with the after_action make them still appear in the output of AshJsonApi and I would prefer them to not appear at all. Are there other approaches I could take?
Compilation error on anonymous function argument with multiple clauses
Given an extension with these definitions:
```elixir
@event_handler [
type:
{:spark_function_behaviour, ChannelHandler.Plugs.Handler,...
Compiler Warnings in Resources
Hi, I'm getting compiler warnings stating that I have unused aliases in my Resources but when I remove them I get compile errors because it can't find the module. Is it possible that this has something to do with how the resources get compiled?
Modifying results after reading
Hi, 👋 I need to manipulate the data returned from a database query. I found out how to do my own read based on Ash.Resource.ManualRead, but how can I call the default logic to apply my changes afterwards? Or is there some kind of after_read hook where I could do so? I would appreciate som pointers… 😇
Validate belongs_to exists
How can I validate that for the following resource the
level_id
is not blank and that the Level
resource for that level_id
exists?
```elixir
attributes do
uuid_primary_key :id...Ash and MySQL ?
Hi,
I've just discovered Ash, and it looks very interesting. In particular I love the idea of a declarative data model representation. However I've a problem : Im' in an environment where I must use MySQL (well... a Percona xtradb cluster actually). Is it possible to use Ash with MySQL ? Is there a data layer for MySQL (didn't find one) ? Is Ash usable with a db bu twithout a data layer ? Or even, how much work would it be to make a MySQL data layer for Ash ?
Thanks in advance....
Create a resource including a belongs_to id
I have this resource with the name
location
:
```
attributes do
uuid_primary_key :id...Can´t get json-api to work when passing arguments.
My api is working with no arguments but I can´t understand how to do it with passing arguments.
```elixir
defmodule AshDatastore.Documents.Syllabus do
use Ash.Resource,...
Multiple Relationships with single attribute.
I'm setting up my resources (Flower Shop). I have a people resource and an order resource. My order resource will have at least 3 attributes that can be people. a person can be the *designer *of an order, a person can be the *salesperson *for an order, and a person could be the *driver *for an order. I've struggled to find a good example of this.
Ash Flow branch condition
I'm trying to do something like this:
```
check if record exists
branch on record not existing
create record with linked belongs_to record...
Multi-node deployments
How does ash work when deployed with multiple nodes e.g. across AWS regions are the notifiers only called on the node where it occurs or are they distributed?
GitHub authentication doesn't work
I've originally asked about this in #authentication-archive but then it was archived so I'm moving the discussion here (as it still unresolved).
---------------------
Hey guys, I'm trying to setup github authentication. I followed the guide but it doesn't work 😦 when I click " Sign in with Github " it opens
http://localhost:4000/auth/user/github
but doesn't redirect....
Should resources with relationships spanning multiple Ash APIs be included in all registries
Hi folks,
I've introduced two Ash APIs (Accounts and Invoicing) with one resource each (
MyApp.Accounts.User
MyApp.Invoicing.Invoice
), and one registry for each API, each with the corresponding resource.
As I introduce the relationship where Invoice belongs_to
User and the inverse User has_many
Invoice, the ResourceValidations
extension started to complain :...How to use arguments in policies
I have a
rooms has_many members
situation in which I want to authorize joining a room if the user has its invite code, but I can't seem to make it work, even after repeatedly reading through the docs, example apps and source code.
The room resource looks like this:
```elixir
policies do...Auto generate a slug
I have the following attributes and would like to autogenerate a
uuid_primary_key :id attribute :name, :string...
slug
from the name
. Until now I always used https://github.com/wemake-services/ecto_autoslug_field to do this. What is the ash way to solve this?
`attributes douuid_primary_key :id attribute :name, :string...
Sending emails with Ash
Does Ash have a wrapper for Sending emails or a recommended way to send transactional emails e.g. Confirm Account?
Cannot use `^variable` outside of match clauses
This error disappears when you add
import Ash.Query
but then Elixir complains that it is an unneeded import, is there a better way around this?