Skip to content

Commit 64fd265

Browse files
committed
WIP 20250515-1642
1 parent 26f310e commit 64fd265

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/random/default_random.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ defmodule AshRandomParams.DefaultRandom do
4141
tag_value = type_info |> Keyword.fetch!(:tag_value)
4242
attr_names = subtype |> Ash.Resource.Info.attributes() |> Enum.map(& &1.name)
4343

44+
primary_create = subtype |> Ash.Resource.Info.primary_action(:create)
45+
4446
subtype
45-
|> Ash.Changeset.for_create(:fac_rec, %{}, ash_opts)
47+
|> Ash.Changeset.for_create(primary_create, %{}, ash_opts)
4648
|> Ash.create!(ash_opts)
4749
|> Map.from_struct()
4850
|> Map.take(attr_names)

0 commit comments

Comments
 (0)