Skip to content

Instantly share code, notes, and snippets.

@dfischer
Created May 22, 2013 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dfischer/146575b302d4517ec7f2 to your computer and use it in GitHub Desktop.
Save dfischer/146575b302d4517ec7f2 to your computer and use it in GitHub Desktop.
class Manager < ActiveRecord::Base
belongs_to :user
belongs_to :client, :class_name => "User"
end
has_many :managers, :foreign_key => :client_id
has_many :manager_users, :through => :managers, :source => :user
has_many :clients, :class_name => "Manager"
has_many :client_users, :through => :clients, :source => :client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment