A smarter way to have many-to-many relationships in Ruby on Rails.