1

I want a "friend" relationship, as in "social site friends", which means: if I'm friending you you invariably friend me. If I remove you from friends, you do that, too. (well, you get the idea).

Currently this is done with duplicate relations and an observer to add/remove the second (more correctly, "other") relation when the first gets created/deleted.

What's the convenient way to implement the subject without duplicating records in the relation table? Maybe there's a gem/plugin to do this?

Ryan Bigg
  • 106,965
  • 23
  • 235
  • 261
Leonid Shevtsov
  • 14,024
  • 9
  • 51
  • 82

1 Answers1

0

Fortunately there is a Railscast on this very topic! Or if you prefer, you can read the instructions as an ASCIIcast.

John Topley
  • 113,588
  • 46
  • 195
  • 237