ash_csv/test/support/resources/comment.ex

26 lines
409 B
Elixir
Raw Normal View History

2020-10-06 18:36:35 +13:00
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
2021-01-13 14:39:10 +13:00
uuid_primary_key :id
2020-10-06 18:36:35 +13:00
attribute(:title, :string)
end
relationships do
belongs_to(:post, AshCsv.Test.Post)
end
end