ash/test/support/flow/org.ex
2022-09-20 19:44:04 -04:00

28 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