Linking a model to itself
I have a resource model which contains a file and some data about it. I
want to "link" resources together if they are related (aka a video
resource with a transcript resource).
I'm not 100% sure how i want to accomplish this with the code. I was
thinking about doing has_and_belongs_to_many but i'm not sure if that is
the proper way of doing it or not.
Ideally I want it to work bi-directionally without additional work if
possible, so linking r1 -> r2 in turn links r2 -> r1. It is possible that
there are 4 Resources linked together, and to link one more I don't want
to create a link from those 4 to the new one and the new one to those 4
(thus creating 8 new 'links').
class Resource < ActiveRecord::Base
??