I have a many-to-many relation that uses an intermediate join model and
the :through option of has_many, like this
ModelA
has_many ModelAB
has_many ModelB :through ModelAB
ModelB
has_many ModelAB
has_many ModelA :through ModelAB
ModelAB
belongs_to ModelA
belongs_to ModelB
Now it is easy to find all ModelB objects that are connected to some
ModelA object. But what is the best way to find all ModelB objects that
are NOT connected to some specific ModelA object?
What is the usual pattern to let the user add new ModelA objects to some
ModelB object? I am considering to show a list of objects that are not
yet added and let them select the ones to be added via some checkbox.
So how can I find the set of ModelA objects not connected to the current
ModelB object (or vice versa)?