ash_cubdb/test/support/author.ex

34 lines
522 B
Elixir
Raw Normal View History

2023-08-07 17:47:06 +12:00
defmodule Support.Author do
@moduledoc false
2024-03-28 10:27:46 +13:00
use Ash.Resource, data_layer: AshCubDB.DataLayer, domain: Support.Domain
2023-08-07 17:47:06 +12:00
cubdb do
otp_app :ash_cubdb
end
multitenancy do
strategy :context
global? true
2023-08-07 17:47:06 +12:00
end
attributes do
uuid_primary_key :id
2023-08-07 17:47:06 +12:00
2024-03-28 10:27:46 +13:00
attribute :name, :ci_string, public?: true
2023-08-07 17:47:06 +12:00
end
relationships do
has_many :posts, Support.Post
2023-08-07 17:47:06 +12:00
end
actions do
2024-03-28 10:27:46 +13:00
default_accept :*
defaults ~w[create read]a
2023-08-07 17:47:06 +12:00
end
code_interface do
define :create
define :read
2023-08-07 17:47:06 +12:00
end
end