Delete related exercise collection items when deleting exercises or collections

This commit is contained in:
Maximilian Grundke
2018-08-22 13:47:27 +02:00
parent 11dc48dc96
commit b5c3ce2113
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ class Exercise < ActiveRecord::Base
has_and_belongs_to_many :proxy_exercises
has_many :user_proxy_exercise_exercises
has_many :exercise_collection_items
has_many :exercise_collection_items, dependent: :delete_all
has_many :exercise_collections, through: :exercise_collection_items, inverse_of: :exercises
has_many :user_exercise_interventions
has_many :interventions, through: :user_exercise_interventions