Updating an associated schema of a belongs_to association

Got an (lv) app with the following associations:

belongs_to: family, App.People.Family

has_many(:members, App.People.Person)

I’ve got the Person loaded, along with the associations for family and members. Imagine my family has 5 members, and I want to add the 6th.

Since I know the id of the sixth member, I was thinking I could add using put_assoc, like:

    person = People.get_person_with_name(%{id: id})
    existing_family = Map.get(socket.assigns.changeset.changes, :family, socket.assigns.person.family)
    new_fam_members = existing_family.members ++ [person]

    changeset =
      |> Ecto.Changeset.put_assoc(:family , Map.merge(existing_family, %{members: new_fam_members} ))

But when I IO.inspect that changeset all I get is:

#Ecto.Changeset<action: nil, changes: %{}, errors: [],
 data: #App.People.Person<>, valid?: true>

No Changes! :frowning_face:

What have I done wrong/not understood?

Are the records that are loaded in existing_family having their primary keys set?

Yes, because they’re existing person records, the ids are set (on the person record)
This is not like a post -> has_many :comments association because I’m not explicitly creating a new record for each comment though.
I set the family ID on the person record and that will give me the members for that family.
Perhaps I haven’t got this part quite right either. has_many through comes to mind.