I have a site where Users can become Friends with other Users. I used to
do this with a habtm, but of course I want to stay up-to-date and
convert this to a has_many :trough. Unfortunately I can’t get it to
work… the documentation on this feature is a bit sparse at the moment.
This is my old habtm:
has_and_belongs_to_many :friends, :join_table => ‘user_friends’,
:foreign_key => ‘user_id’, :association_foreign_key => ‘friend_id’,
:class_name => ‘Person’
I’ve tried various things, but I’m completely lost now. I looked at the
:source option, but that doesn’t allow me to do this and the :class_name
parameter doesn’t seem to work either. Any hints?