ash/test/support/flow/org.ex

29 lines
547 B
Elixir
Raw Normal View History

defmodule Ash.Test.Flow.Org do
2022-09-21 11:44:04 +12:00
@moduledoc false
use Ash.Resource, data_layer: Ash.DataLayer.Mnesia
identities do
identity :unique_name, [:name], pre_check_with: Ash.Test.Flow.Api
2022-09-21 11:44:04 +12:00
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.Flow.User
2022-09-21 11:44:04 +12:00
end
end