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.
Joinmark Ash.Resource extension attributes as public
extensions: [AshDoubleEntry.Transfer, AshGraphql.Resource]
extensions: [AshDoubleEntry.Transfer, AshGraphql.Resource]
AshDoubleEntry.Transfer creates itQuery load and sort
locations with a geometry field :geom (using ash_geo + geo_postgis). When a user lands on a page and geolocates, the list of locations should sort ASC based on the user location and show the distance away in miles.
My current query is:
```
query...Enum.reduce flipping the order later onWorking with AshArchival
Ash.Query.filter_input(query, %{"archived_at" => %{"is_nil" => false}})
Ash.Query.filter_input(query, %{"archived_at" => %{"is_nil" => false}})
:include_archived action for example, exclude that action in the ash archival DSL, you can then pass action: :include_archived to Ash.readForbidden magic link
dev/mailbox but when I click it I'm taken to a page that has a "sign in" button, and once I click that, I get:
``` [warning] Authentication failed:
Bread Crumbs:
Error returned from: MyApp.Accounts.User.sign_in_with_magic_link...
Accessing_from policy not authorizing read preparation
Setting up a has_many relationship through another resource?
has_many(:comments, through: [:posts, :comments])
has_many(:comments, through: [:posts, :comments])
Ash Policies around :change_password action
User resource with (mostly) the default update :change_password action generated by the igniter installer,
```elixir
update :change_password do
# Use this action to allow users to change their password by providing
# their current password and a new password....Global Analytics
no_attributes? true relationships but I'm getting some errors including
```
errors: [...Multiple confirmation strategies with interaction
require_interaction? true with more than one confirmation strategy, because using the confirm_route macro more than once produces a compile-time error.
confirm_route MyApp.Accounts.User, :confirm_new_user, auth_routes_prefix: "/auth"
confirm_route MyApp.Accounts.User, :confirm_email_change, auth_routes_prefix: "/auth"
confirm_route MyApp.Accounts.User, :confirm_new_user, auth_routes_prefix: "/auth"
confirm_route MyApp.Accounts.User, :confirm_email_change, auth_routes_prefix: "/auth"
as optionOptional argument with defaults for actions
constraints: [allow_empty?: true]Typed array attributes from `ash.gen.resource`
Setting attributes after getting data in before_transaction - calling validation in change_attribute
User resource which requires email and a name. I want to expose a create type action on this resource, but all I have available when calling the action is a token. That token is in a 3rd party system, which returns the name and email. This resource has global validation on name and email, which I'd rather not change (or mark as before_action?: true) since I do want them to be run up front for other actions.
What I was hoping to do is in a before_transaction block, make the API call to get the data and set the attributes with change_attribute, or put them in a context and call set_attribute in a change block. However, when I do this, since the initial changeset doesn't have an email, it fails validation and the before_transaction never runs. If I pass in a placeholder email, I can get the before_transaction to run, but then I get warnings when calling change_attribute because the changeset has already been validated, and it's actually possible to pass in a bad email here and it'll get written to the database.
Another idea I had was to try and do this as a generic action, and then in the run block I would make the API call, get the user data, and then manually call the existing :create . However, I need to return metadata (access tokens) for the user, but it seems like generic actions don't allow for metadata blocks, and since this action will be exposed via GraphQL, I'd want that typing of the metadata attributes on the query/mutation....Complex resource generation?
Subtitle belongs to a Video, and a Video has many Subtitles. Whenever I try to crate one, the othe must be already present, otherwise I get an error. Maybe I'm doing something wrong?
```bash...Any reason expressions are not supported in validations?
Policy references

Best way to consist between attributes validation and Postgres level
check_constraints ?
```elixir...Atomic array removal
array_remove. I have the following change:
```
attribute :thing_ids, {:array, :string}, public?: true...Is there an alternative way to select certain fields without using Ash.Query?
Custom query run in action
Repo.query! 🤔 my attempts fail. Seems I can't use the Repo module in an action 😬How to wrap multiple bulk updates in transaction
[%{id: 1, exposed: true}, %{id: 2, exposed: false}, %{id: 3, exposed: true}, ...]
[%{id: 1, exposed: true}, %{id: 2, exposed: false}, %{id: 3, exposed: true}, ...]