fix: add resource to Ash.Seed.seed! in Ash.Generator.seed! (#1227)

This commit is contained in:
Robert Timis 2024-06-07 13:31:29 +02:00 committed by GitHub
parent 1b4edfd066
commit 4d35117649
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -147,7 +147,7 @@ defmodule Ash.Generator do
seed_input(resource, generators)
|> Enum.at(0)
Ash.Seed.seed!(input)
Ash.Seed.seed!(resource, input)
end
@doc """

View file

@ -281,6 +281,12 @@ defmodule Ash.Test.GeneratorTest do
end
end
describe "seed" do
test "it seeds correctly a resource" do
assert %Author{} = Ash.Generator.seed!(Author, @meta_generator)
end
end
describe "built in generators" do
for type <- Enum.uniq(Ash.Type.builtin_types()), type != Ash.Type.Keyword do
for type <- [{:array, type}, type] do