Forum: Ruby on Rails Architecture/model related question

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Melvin R. (Guest)
on 2008-11-24 19:25
(Received via mailing list)
I've currently got 3 models: User, Lesson and Course

The associations are:
* Lesson belongs_to Course
* Course has_many Lessons

* Course belongs_to User
* User has_many Courses

Now I'm adding a new model for LessonCompletion, which will be
used to track which lessons the user has completed and when.

LessonCompletion belongs_to Lesson
LessonCompletion belongs_to User

User has_many LessonCompletions
Lesson has_many LessonCompletions

Now the way that this model (LessonCompletion) will be used is
on the Course show page in displaying which lessons are done.

My question is, should I add another association of LessonCompletion
belongs_to Course,
Course has_many LessonCompletions or should I just go with
Course has_many LessonCompletions, :through => :lessons ?

The reason I ask is because I'm wondering if the :through will be very
taxing on the system as it will get used a lot.
This topic is locked and can not be replied to.