2021-01-29 13:42:55 +13:00
|
|
|
defmodule AshPostgres.Test.Rating do
|
|
|
|
@moduledoc false
|
|
|
|
use Ash.Resource,
|
2024-03-28 09:52:28 +13:00
|
|
|
domain: AshPostgres.Test.Domain,
|
2021-01-29 13:42:55 +13:00
|
|
|
data_layer: AshPostgres.DataLayer
|
|
|
|
|
|
|
|
postgres do
|
|
|
|
polymorphic?(true)
|
|
|
|
repo AshPostgres.TestRepo
|
|
|
|
end
|
|
|
|
|
|
|
|
actions do
|
2024-03-28 09:52:28 +13:00
|
|
|
default_accept(:*)
|
|
|
|
|
2022-04-20 03:08:28 +12:00
|
|
|
defaults([:create, :read, :update, :destroy])
|
2021-01-29 13:42:55 +13:00
|
|
|
end
|
|
|
|
|
|
|
|
attributes do
|
|
|
|
uuid_primary_key(:id)
|
2024-03-28 09:52:28 +13:00
|
|
|
attribute(:score, :integer, public?: true)
|
|
|
|
attribute(:resource_id, :uuid, public?: true)
|
2021-01-29 13:42:55 +13:00
|
|
|
end
|
|
|
|
end
|