I have three tables in my DB
users <–> users_courses <–> courses
users and courses are m:n related:
has_many :courses, :through => :user_courses
has_many :users, :through => :user_courses
I want to delete all records for a user in user_courses when deleting
the user. How do i achieve that?