2022-05-23 10:30:20 +12:00
|
|
|
defmodule AshPostgres.Test.Profile do
|
|
|
|
@moduledoc false
|
|
|
|
use Ash.Resource,
|
2024-03-28 09:52:28 +13:00
|
|
|
domain: AshPostgres.Test.Domain,
|
2022-05-23 10:30:20 +12:00
|
|
|
data_layer: AshPostgres.DataLayer
|
|
|
|
|
|
|
|
postgres do
|
|
|
|
table("profile")
|
|
|
|
schema("profiles")
|
|
|
|
repo(AshPostgres.TestRepo)
|
|
|
|
end
|
|
|
|
|
|
|
|
attributes do
|
|
|
|
uuid_primary_key(:id, writable?: true)
|
2024-03-28 09:52:28 +13:00
|
|
|
attribute(:description, :string, public?: true)
|
2022-05-23 10:30:20 +12:00
|
|
|
end
|
|
|
|
|
|
|
|
actions do
|
2024-03-28 09:52:28 +13:00
|
|
|
default_accept(:*)
|
|
|
|
|
2022-05-23 10:30:20 +12:00
|
|
|
defaults([:create, :read, :update, :destroy])
|
|
|
|
end
|
|
|
|
|
|
|
|
relationships do
|
2024-03-28 09:52:28 +13:00
|
|
|
belongs_to(:author, AshPostgres.Test.Author) do
|
|
|
|
public?(true)
|
|
|
|
end
|
2022-05-23 10:30:20 +12:00
|
|
|
end
|
|
|
|
end
|