What's the correct approach to update an actor inside an action
Accounts.User
resource that is normally sent to actions as the actor (this is also the resource used in AshAuthentication, etc).
I also have another API called Payments
and inside of it, it has a resource Payments.Customer
.
Both Accounts.User
and Payments.User
uses the same table, the just have some unique fields to it (mostly Accounts.User
has info about authentication like password, email, etc, and Payments.User
info about Stripe customer id, payments methods, etc)....Authentication failures
How to assign a default value to existing rows via Ash.postgres generated migration code
add :new_field, :string, default: "default value"
add :new_field, :string, default: "default value"
`mix doctor` shows errors for "struct spec" on resource modules
mix doctor
on resource modules, like so...
```
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Doc Cov Spec Cov Module File Functions No Docs No Specs Module Doc Struct Spec
... ...Why store temporary sign in tokens and how to prune them?
store_all_tokens?
indeed stores all tokens, INCLUDING temporary sign in tokens when sign_in_tokens_enabled
is enabled.
First of all, I'm not sure if it's intended behavior. Why do we need to store a tmp token for sign in?
Secondly, I can't find a way to prune it from my DB. I delete the actual token on user sign out, same way as ash_hq does, but I don't have access to that temporary token to delete it -> this leads to handing outdated records in tokens table....Building an aggregates-only Resource
Dashboard
. My first approach was to create a calculation
to calculate a data point. That wasn't going anywhere, so I defined an primary read
action that loaded the data point from inside the prepare
block. That's where I'm at so far. The problem is that calling read()
on the API returns nil
.
Here is an example of the kind of data I want to expose:...Is Ash well suited to Domain Driven Design
Ecto.Multi like transactions
How to write complex query with fragments
Define order of code blocks being added to a migration
attribute match constraints error message
How to bypass ConfirmationHookChange in a specific action
monitor_fields
to be [:email]
.
Now I want to add an action that it "forcefully" change the user e-mail bypassing the whole confirmation process.
Basically the idea is to use that function as an admin-only function....How does AshAuthentication monitor_fields work?
monitor_fields: [:email]
What exactly does that do? Does it "automagically" inserts a change on each action that can change the email
field?...Generic action has `api` nil in context when called from `code_interface`
manage_relationship :remove across API's
Tag
resource that belongs in the Organization
API, I have a Transaction
resource that belongs in the Transactions
API, there is a join resource between them called TransactionTag
that is in the Transaction
API registry.
I am unable to manage_relationship :remove
a Tag
from a Transaction
resource unless I also include the TransactionTag
resource in the Organization
registry. (I get a ResourceNotAllowed error otherwise)
Is this expected behaviour? ...Where do I find documentation on `contains()` , for use within an Ash.Query.filter()?
Ash.Query
functions list on the right side): https://ash-hq.org/docs/module/ash/latest/ash-query#macro-filter-2
...Primary key as string (not UUID)
integer_primary_key()
, and uuid_primary_key()
. If I try leaving either of those out, it returns an error that says I need to specify a primary key. How can this be made to work?How to determine API boundaries?
Any examples of using can?
** (ArgumentError) Invalid action/query/changeset "nil"...
Simulating arguments on relationships with calculations