Browse Source

task: user dependent destroy

Lou 3 years ago
parent
commit
6bfb3322f3
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      app/models/user.rb

+ 1
- 1
app/models/user.rb View File

@@ -9,7 +9,7 @@ class User < ApplicationRecord
9 9
   has_many :joined_user_activities
10 10
   has_many :activities, :through => :joined_user_activities
11 11
 
12
-  has_many :tasks, foreign_key: 'owner_id', class_name: 'Task'
12
+  has_many :tasks, foreign_key: 'owner_id', class_name: 'Task', dependent: :destroy
13 13
   
14 14
   has_many :memberships, foreign_key: :member_id, dependent: :destroy
15 15
   has_many :teams, through: :memberships

Loading…
Cancel
Save