mirror of
https://github.com/ash-project/ash.git
synced 2024-09-20 21:43:02 +12:00
29 lines
571 B
Elixir
29 lines
571 B
Elixir
|
defmodule Ash.Test.Support.Flow.Org do
|
||
|
@moduledoc false
|
||
|
use Ash.Resource, data_layer: Ash.DataLayer.Mnesia
|
||
|
|
||
|
identities do
|
||
|
identity :unique_name, [:name], pre_check_with: Ash.Test.Support.Flow.Api
|
||
|
end
|
||
|
|
||
|
actions do
|
||
|
defaults [:create, :read, :update, :destroy]
|
||
|
|
||
|
read :by_name do
|
||
|
argument :name, :string, allow_nil?: false
|
||
|
get? true
|
||
|
|
||
|
filter expr(name == ^arg(:name))
|
||
|
end
|
||
|
end
|
||
|
|
||
|
attributes do
|
||
|
uuid_primary_key :id
|
||
|
attribute :name, :string
|
||
|
end
|
||
|
|
||
|
relationships do
|
||
|
has_many :users, Ash.Test.Support.Flow.User
|
||
|
end
|
||
|
end
|