Jmanda
AEAsh Elixir
•Created by Jmanda on 4/20/2024 in #showcase
My proof of concept project (FleetMS) built with Ash
Yes, am rewriting everything here: https://github.com/jmnda-dev/fleetms, nothing much yet but will push much over the weekend
6 replies
AEAsh Elixir
•Created by Jmanda on 4/20/2024 in #showcase
My proof of concept project (FleetMS) built with Ash
Sure 😁
6 replies
AEAsh Elixir
•Created by drumusician on 6/11/2023 in #support
Custom / virtual fields on read
You can also try to add
primary? true
to your read
action? And it's likely you're referencing a module that does not exist, take a look at these discussions: https://discord.com/channels/711271361523351632/799097774523547669/861263803056652288 and https://discord.com/channels/711271361523351632/799097774523547669/82343814680425270217 replies
AEAsh Elixir
•Created by drumusician on 6/11/2023 in #support
Custom / virtual fields on read
So I have never used AshGraphql before, but perhaps you can share your code I see how you are defining the GraphQL api in your resource? At least that will provide more context.
17 replies
AEAsh Elixir
•Created by drumusician on 6/11/2023 in #support
Custom / virtual fields on read
Awesome 🥳
17 replies
AEAsh Elixir
•Created by drumusician on 6/11/2023 in #support
Custom / virtual fields on read
Do you want to have a virtual field in your resource whose value is based on the existing field/attribute? If that's the case the you can use
Ash Calculations
: https://ash-hq.org/docs/guides/ash/latest/topics/calculations. For example if you have a User
resource like the following:
you can add a full_name
calculation(virtual field) to your resource by declaring a calculation
:
that way you can now use user.full_name
even if its not defined in your resource attributes
. I think you can use the calculation
in Ash.Query
as well.
If that's not what you're looking for you can share some code to provide additional context.17 replies
AEAsh Elixir
•Created by Jmanda on 4/30/2023 in #support
Implementating auto-incrementing/sequence fields in Ash Resources
Thanks for your feedback. I will also do some research regarding database triggers. For the sake of making progress 😄, will try to implement what I mentioned previously then do proper implementation later.
3 replies
AEAsh Elixir
•Created by Jmanda on 3/19/2023 in #support
** (KeyError) key :options not found: Error on AshPhoenix.Form submit
No worries I understand 😁 , thanks for your feedback
9 replies
AEAsh Elixir
•Created by Jmanda on 3/19/2023 in #support
** (KeyError) key :options not found: Error on AshPhoenix.Form submit
Oh I see
9 replies
AEAsh Elixir
•Created by Jmanda on 3/19/2023 in #support
** (KeyError) key :options not found: Error on AshPhoenix.Form submit
Here is the stacktrace:
This is the code in handle event and on line 87 in my FormComponent:
9 replies
AEAsh Elixir
•Created by Jmanda on 2/17/2023 in #support
Override/Extend AshAuthentication Sign in
Okay will do that. Thanks for the help once again 😃
10 replies
AEAsh Elixir
•Created by Jmanda on 2/17/2023 in #support
Override/Extend AshAuthentication Sign in
@Zach Daniel
I managed to implement that and it worked. However I have an issue, the current user is missing in the liveview socket
I have set the
on_mount:
callback like this:
And in the router.ex
* note that am setting the tenant, as the user is not on the public schema
So whats happening is that when the liveview mounts(first time when socket not connected), the socket has a current_user
, cause the tenant is the Process
, however when the liveview is mounted again(when socket is connected), the socket does not have a current_user
assigned, probably because the liveview is now in a new PID
, where tenant is not set, resulting the user query running on the public_schema
instead of a tenant schema. Is there a way I can resolve this?10 replies
AEAsh Elixir
•Created by Jmanda on 2/17/2023 in #support
Override/Extend AshAuthentication Sign in
Thank you Zach, I will try that
10 replies
AEAsh Elixir
•Created by waseigo on 2/10/2023 in #support
Example of setting a has_one relationship
You can take a look at https://ash-hq.org/docs/module/ash/latest/ash-query#function-load-2 for loading nested relationships
10 replies
AEAsh Elixir
•Created by waseigo on 2/10/2023 in #support
Example of setting a has_one relationship
I think in
App.Api.Variant
you have to define a belongs_to
as supposed to adding attribute :item_id, :uuid
, so something like:
10 replies
AEAsh Elixir
•Created by Jmanda on 2/8/2023 in #support
Create an Org on public schema and initial User on Org schema
Updated the deps, am now able to create a User using
:register_with_password
action22 replies
AEAsh Elixir
•Created by Jmanda on 2/8/2023 in #support
Create an Org on public schema and initial User on Org schema
Alright 😁 , let me do that, will report back
22 replies
AEAsh Elixir
•Created by Jmanda on 2/8/2023 in #support
Create an Org on public schema and initial User on Org schema
22 replies
AEAsh Elixir
•Created by Jmanda on 2/8/2023 in #support
Create an Org on public schema and initial User on Org schema
So what can an implementation in
register_your_user_here(..., tenant: org.schema_name)
look like?
Is it right to do it this way:
although the above code is raising an error:22 replies
AEAsh Elixir
•Created by Jmanda on 1/31/2023 in #support
Setting Tenant when using Context Multitenancy
In the meantime will just "handroll" my own, shouldn't be hard I have done it before 😁
23 replies