Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #User.rb
- has_many :courses
- has_many :enrollments
- has_many :enrolled_courses, through: :enrollments, source: :course
- #Enrollment.rb
- belongs_to :course
- belongs_to :user
- #Course.rb
- belongs_to :user
- has_many :enrollments
- has_many :users, through: :enrollment
Add Comment
Please, Sign In to add comment