chore: small doc updates, remove incorrect/old docs

This commit is contained in:
Zach Daniel 2024-04-06 15:20:22 -04:00
parent 3c6a556da8
commit d55864713a
6 changed files with 16 additions and 51 deletions

View file

@ -154,7 +154,6 @@ end
The following steps are performed when you call `Ash.Query.for_read/4`.
- [Gather Process Context](/documentation/topics/store-context-in-process.md)
- Cast input arguments - `d:Ash.Resource.Dsl.actions.read.argument`
- Set default argument values - `d:Ash.Resource.Dsl.actions.read.argument|default`
- Add errors for missing required arguments | `d:Ash.Resource.Dsl.actions.read.argument|allow_nil?`
@ -213,7 +212,6 @@ end
The following steps are run when calling `Ash.Changeset.for_create/4`, `Ash.Changeset.for_update/4` or `Ash.Changeset.for_destroy/4`.
- [Gather process context](/documentation/topics/store-context-in-process.md)
- Cast input params | This is any arguments in addition to any accepted attributes
- Set argument defaults
- Require any missing arguments

View file

@ -1,18 +0,0 @@
# Phoenix
Ash plays nicely with phoenix. There are a few things to consider when using them side-by-side.
## Adding Ash to an existing Phoenix app
To add Ash to an existing application is easy, generally only involves updating your `Ecto.Repo` to use `AshPostgres.Repo` if you are using `AshPostgres`. Other than that, you can follow the guides as usual.
## Creating a new Phoenix app
If you want to use `AshPostgres`, you have two options here:
1. create a phoenix app as normal, and when you set up `AshPostgres`, ignore the steps for creating the repo, and instead update it to use `AshPostgres.Repo`.
2. create the app with `--no-ecto` and follow the AshPostgres guide getting started guide fully.
## Using Extensions
If you are using extensions like AshGraphql or AshJsonApi, you will want to follow their getting started guides separately.

View file

@ -1,11 +0,0 @@
# Store Context In Process
There are various things that can be stored in the process dictionary as opposed to passing them to every function. This is a stylistic choice, and in many cases could lead to *less* clear code, so use with caution. See the functions in the `Ash` module for more.
The following things can be stored in the process:
- Query/changeset context, will be merged with the context of any query/changeset before it is run.
- The current actor (i.e current_user)
- Whether or not to run authorization, i.e `authorize?`
- The current tracer
- The current tenant

View file

@ -150,7 +150,7 @@ defmodule Helpdesk.Support.Ticket do
# Use the default implementation of the :read action
defaults [:read]
# and a custom create action, which we'll customize later
# and a create action, which we'll customize later
create :create
end
@ -591,24 +591,24 @@ Where Ash shines however, is all of the tools that can work *with* your resource
#### Get Help
- Check out [ElixirForum](https://elixirforum.com/c/elixir-framework-forums/ash-framework-forum/123)
- Check out [ElixirForum](https://elixirforum.com/c/ash-framework-forum)
- Join our [Discord server](https://discord.gg/D7FNG2q)
- Open a [GitHub issue](https://github.com/ash-project/ash/issues/new/choose)
#### Persist your data
See [The AshPostgres getting started guide](https://hexdocs.pm/ash_postgres) to see how to back your resources with Postgres. This is highly recommended, as the Postgres data layer provides tons of advanced capabilities.
#### Add a web API
Check out [AshJsonApi](https://hexdocs.pm/ash_json_api) and [AshGraphql](https://hexdocs.pm/ash_graphql) extensions to build APIs around your resource
#### Authorize access and work with users
See the [Policies guide](/documentation/topics/policies.md) for information on how to authorize access to your resources using actors and policies.
#### Clean up your code that uses Ash?
Creating and using changesets manually can be verbose, and they all look very similar. Luckily, Ash has your back and can help you build high quality interfaces for you!
Check out the [Code Interface Guide](/documentation/topics/code-interface.md) to derive things like `Helpdesk.Support.Ticket.assign!(representative.id)`
#### Persist your data
See [The AshPostgres getting started guide](https://hexdocs.pm/ash_postgres/get-started-with-postgres.html) to see how to back your resources with Postgres. This is highly recommended, as the Postgres data layer provides tons of advanced capabilities.
#### Add a web API
Check out the `AshJsonApi` and `AshGraphql` extensions to build APIs around your resources
#### Authorize access and work with users
See the [Policies guide](/documentation/topics/policies.md) for information on how to authorize access to your resources using actors and policies.

View file

@ -75,13 +75,11 @@ defmodule Ash.MixProject do
"documentation/topics/multitenancy.md",
"documentation/topics/notifiers.md",
"documentation/topics/pagination.md",
"documentation/topics/phoenix.md",
"documentation/topics/policies.md",
"documentation/topics/pub_sub.md",
"documentation/topics/reactor.md",
"documentation/topics/relationships.md",
"documentation/topics/security.md",
"documentation/topics/store-context-in-process.md",
"documentation/topics/testing.md",
"documentation/topics/timeouts.md",
"documentation/topics/validations.md",
@ -107,6 +105,7 @@ defmodule Ash.MixProject do
"documentation/topics/about_ash/what-is-ash.md",
"documentation/topics/about_ash/design-principles.md",
"documentation/topics/about_ash/contributing-to-ash.md",
"documentation/topics/upgrading-to-3.0.md",
"CHANGELOG.md"
],
"How To": [],
@ -127,7 +126,6 @@ defmodule Ash.MixProject do
"documentation/how_to/defining-manual-relationships.md",
"documentation/how_to/handle-errors.md",
"documentation/how_to/structure-your-project.md",
"documentation/how_to/upgrade.md",
"documentation/how_to/use-without-data-layers.md",
"documentation/how_to/validate-changes.md",
"documentation/how_to/auto-format-code.md",
@ -150,13 +148,11 @@ defmodule Ash.MixProject do
"documentation/topics/multitenancy.md",
"documentation/topics/notifiers.md",
"documentation/topics/pagination.md",
"documentation/topics/phoenix.md",
"documentation/topics/policies.md",
"documentation/topics/pub_sub.md",
"documentation/topics/reactor.md",
"documentation/topics/relationships.md",
"documentation/topics/security.md",
"documentation/topics/store-context-in-process.md",
"documentation/topics/testing.md",
"documentation/topics/timeouts.md",
"documentation/topics/validations.md"
@ -165,7 +161,7 @@ defmodule Ash.MixProject do
skip_undefined_reference_warnings_on: [
"CHANGELOG.md",
"documentation/topics/glossary.md",
"documentation/how_to/upgrade.md"
"documentation/topics/upgrading-to-3.0.md"
],
nest_modules_by_prefix: [
Ash.Error,