docs: remove registries from docs and examples (#388)

This commit is contained in:
Zach Daniel 2023-08-16 00:58:48 -07:00 committed by GitHub
parent d7e03ce111
commit 575785c3f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 41 deletions

View file

@ -24,11 +24,6 @@ config :ash_authentication, Example.Repo,
show_sensitive_data_on_connection_error: true, show_sensitive_data_on_connection_error: true,
pool_size: 10 pool_size: 10
config :ash_authentication, Example,
resources: [
registry: Example.Registry
]
config :ash_authentication, config :ash_authentication,
authentication: [ authentication: [
strategies: [ strategies: [

View file

@ -10,11 +10,6 @@ config :ash_authentication, Example.Repo,
pool: Ecto.Adapters.SQL.Sandbox, pool: Ecto.Adapters.SQL.Sandbox,
pool_size: 10 pool_size: 10
config :ash_authentication, Example,
resources: [
registry: Example.Registry
]
config :bcrypt_elixir, :log_rounds, 4 config :bcrypt_elixir, :log_rounds, 4
config :ash, :disable_async?, true config :ash, :disable_async?, true

View file

@ -1,4 +1,4 @@
defmodule DevServer.JsonApiRouter do defmodule DevServer.JsonApiRouter do
@moduledoc false @moduledoc false
use AshJsonApi.Api.Router, api: Example, registry: Example.Registry use AshJsonApi.Api.Router, api: Example
end end

View file

@ -101,7 +101,8 @@ defmodule MyApp.Accounts do
use Ash.Api use Ash.Api
resources do resources do
registry MyApp.Accounts.Registry resource MyApp.Accounts.User
resource MyApp.Accounts.Token
end end
end end
``` ```
@ -113,21 +114,6 @@ Be sure to add it to the `ash_apis` config in your `config.exs`
config :my_app, :ash_apis, [..., MyApp.Accounts] config :my_app, :ash_apis, [..., MyApp.Accounts]
``` ```
Next, let's define our registry:
```elixir
# lib/my_app/accounts/registry.ex
defmodule MyApp.Accounts.Registry do
use Ash.Registry, extensions: [Ash.Registry.ResourceValidations]
entries do
entry MyApp.Accounts.User
entry MyApp.Accounts.Token
end
end
```
Next, let's define our `Token` resource. This resource is needed Next, let's define our `Token` resource. This resource is needed
if token generation is enabled for any resources in your application. Most of if token generation is enabled for any resources in your application. Most of
the contents are auto-generated, so we just need to provide the data layer the contents are auto-generated, so we just need to provide the data layer

View file

@ -3,7 +3,10 @@ defmodule Example do
use Ash.Api, otp_app: :ash_authentication, extensions: [AshGraphql.Api, AshJsonApi.Api] use Ash.Api, otp_app: :ash_authentication, extensions: [AshGraphql.Api, AshJsonApi.Api]
resources do resources do
registry Example.Registry resource Example.User
resource Example.UserWithTokenRequired
resource Example.Token
resource Example.UserIdentity
end end
json_api do json_api do

View file

@ -1,11 +0,0 @@
defmodule Example.Registry do
@moduledoc false
use Ash.Registry, extensions: [Ash.Registry.ResourceValidations]
entries do
entry Example.User
entry Example.UserWithTokenRequired
entry Example.Token
entry Example.UserIdentity
end
end