I am developing an application, with a years model and a courses model. Currently there is a has_and_belongs_to_many relationship linking these with a courses_years table, however I would like to store an extra field in the courses_years table.
The new field is a boolean value called "compulsory".
Is there an easy or nice way of doing this?
Switch to using a :has_many => :through
association, which is specifically designed for when you need a join model. There are more details in the ActiveRecord Associations Rails Guide.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With