Skip to content

Instantly share code, notes, and snippets.

@austinrfnd
Created June 25, 2013 05:28
Show Gist options
  • Save austinrfnd/5856131 to your computer and use it in GitHub Desktop.
Save austinrfnd/5856131 to your computer and use it in GitHub Desktop.
Another jewel I found in a code base
has_many :enrollments, class_name: "CourseEnrollment", conditions: "course_enrollments.role='student'", dependent: :destroy
has_many :student_enrollments, class_name: "CourseEnrollment", conditions: "course_enrollments.role='student'", dependent: :destroy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment