I got the following class:
class Member < ActiveRecord::Base
:class_name => ‘Member’,
:join_table => ‘members_have_buddies’,
:foreign_key => ‘member_id’,
:association_foreign_key => ‘buddy_id’
You can see that a member can have any other member as a “buddy”; these
relationships are held in the table members_have_buddies (member_id,
So far, so good.
I have a member “my_member”, that has 3 other members marked as buddies,
so I got 3 entries in the members_have_buddies table.
When I delete my_member, then the 3 entries in the table are also
deleted, as I expect it to do.
But when I delete one of the 3 other members, that are marked as
members, then the related entry in the members_have_buddies table does
not get deleted!
I assume, this is an error, is it? Or have I done anything wrong? How
can I solve this problem?
Thanks a lot for help.