ash_postgres/test/support/resources/record.ex
Zach Daniel 37cc01957d
improvement!: 3.0 (#227)
* WIP

* chore: fix mix.lock merge issues

* improvement: upgrade to 3.0

* chore: remove `repo.to_tenant`

* chore: continue removal of unnecessary helper

* chore: use `Ash.ToTenant`
2024-03-27 16:52:28 -04:00

39 lines
687 B
Elixir

defmodule AshPostgres.Test.Record do
@moduledoc false
use Ash.Resource,
domain: AshPostgres.Test.Domain,
data_layer: AshPostgres.DataLayer
attributes do
uuid_primary_key(:id)
attribute(:full_name, :string, allow_nil?: false, public?: true)
timestamps(public?: true)
end
relationships do
alias AshPostgres.Test.Entity
has_one :entity, Entity do
public?(true)
no_attributes?(true)
read_action(:read_from_temp)
filter(expr(full_name == parent(full_name)))
end
end
postgres do
table "records"
repo AshPostgres.TestRepo
end
actions do
default_accept(:*)
defaults([:create, :read])
end
end