ash_csv/test/support/resources/comment.ex
2020-10-06 01:37:47 -04:00

25 lines
462 B
Elixir

defmodule AshCsv.Test.Comment do
@moduledoc false
use Ash.Resource,
data_layer: AshCsv.DataLayer
csv do
create? true
columns [:id, :title]
file "test/data_files/comments.csv"
end
actions do
read(:read)
create(:create)
end
attributes do
attribute(:id, :uuid, primary_key?: true, default: &Ecto.UUID.generate/0)
attribute(:title, :string)
end
relationships do
belongs_to(:post, AshCsv.Test.Post)
end
end