Skip to content

Instantly share code, notes, and snippets.

@hoblin
Created January 24, 2011 20:52
Show Gist options
  • Save hoblin/793920 to your computer and use it in GitHub Desktop.
Save hoblin/793920 to your computer and use it in GitHub Desktop.
class Client < ActiveRecord::Base
acts_as_paranoid
has_many :client_users, :dependent => :destroy
has_many :users, :through => :client_users
class ClientUser < ActiveRecord::Base
acts_as_paranoid
belongs_to :client
belongs_to :user
class User < ActiveRecord::Base
acts_as_paranoid
has_many :client_users, :dependent => :destroy
has_many :clients, :through => :client_users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment