mirror of
https://github.com/ash-project/ash_admin.git
synced 2024-09-20 13:23:30 +12:00
3061793e41
fix: various fixes
36 lines
647 B
Elixir
36 lines
647 B
Elixir
defmodule Demo.Tickets.Comment do
|
|
use Ash.Resource,
|
|
data_layer: AshPostgres.DataLayer,
|
|
extensions: [AshAdmin.Resource]
|
|
|
|
admin do
|
|
form do
|
|
field :comment, type: :long_text
|
|
end
|
|
end
|
|
|
|
actions do
|
|
create :create do
|
|
primary? true
|
|
end
|
|
|
|
create :create2
|
|
end
|
|
|
|
postgres do
|
|
repo Demo.Repo
|
|
polymorphic? true
|
|
end
|
|
|
|
attributes do
|
|
uuid_primary_key :id
|
|
|
|
attribute :comment, :string
|
|
attribute :resource_id, :uuid, allow_nil?: false
|
|
end
|
|
|
|
relationships do
|
|
belongs_to :commenting_customer, Demo.Tickets.Customer
|
|
belongs_to :commenting_representative, Demo.Tickets.Customer
|
|
end
|
|
end
|