I am writing a chat-roulette on RoR, I created a Clients table with a field partner_id. Model code:
class Client < ActiveRecord::Base belongs_to :partner, :class_name => 'Client' has_one :partner, :class_name => 'Client', :foreign_key => 'partner_id' end How to do that when assigning client.partner = other_client clients exchange links, and not just it was assigned to one? I understand the deletion events to process before_destroy to clear the partner_id from the partner?
Are there any other ways to create such dependencies?