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
|
2023-10-02 16:15:06 +13:00
|
|
|
strategy :context
|
|
|
|
global? true
|
2023-08-07 17:47:06 +12:00
|
|
|
end
|
|
|
|
|
|
|
|
attributes do
|
2023-10-02 16:15:06 +13:00
|
|
|
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
|
2023-10-02 16:15:06 +13:00
|
|
|
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 :*
|
2023-10-02 16:15:06 +13:00
|
|
|
defaults ~w[create read]a
|
2023-08-07 17:47:06 +12:00
|
|
|
end
|
|
|
|
|
|
|
|
code_interface do
|
2023-10-02 16:15:06 +13:00
|
|
|
define :create
|
|
|
|
define :read
|
2023-08-07 17:47:06 +12:00
|
|
|
end
|
|
|
|
end
|