I have this code It works fine for single assoc and gives me a single changeset. And with one transaction I update the entire record
modell.changeset(records_struct, changeset_params)
|> Ecto.Changeset.cast_assoc(assoc_model)
|> Repo.update()
I have other associations I want to add to the Ecto.Changeset.cast_assoc(assoc_model)
. But I can’t figure out how?
I want it to make a one single changeset for all the associations like this
modell.changeset(records_struct, changeset_params)
|> Ecto.Changeset.cast_assoc(:model1, :model2))
|> Repo.update()
Any ideas?
Thanks