Skip to content

Instantly share code, notes, and snippets.

@jraines
Created September 18, 2010 22:55
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 jraines/586138 to your computer and use it in GitHub Desktop.
Save jraines/586138 to your computer and use it in GitHub Desktop.
#class User
has_many :workouts, :through => :checkins
has_many :coached_workouts, :class_name = "Workout", :foreign_key => "coach_id"
#class Workout
belongs_to :coach, class_name = "User"
#add coach_id column to workout table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment