long time lurker, first time poster.
Consider the following models:
class User < ApplicationRecord accepts_nested_attributes_for :memberships, a