summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-03-24 15:44:17 +0100
committerDouwe Maan <douwe@gitlab.com>2015-03-24 15:44:17 +0100
commite3fb9b1609497e4152e6c14709cb295824372bc9 (patch)
treea6fe39051f11994790839405274fade279674734
parent2953e0d19b46a937ee9d84139adbc263c8e89757 (diff)
downloadgitlab-ce-e3fb9b1609497e4152e6c14709cb295824372bc9.tar.gz
Clean up subscriptions when user is deleted.user-subscriptions-dependent
-rw-r--r--app/models/user.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 50f664a09a3..979150b4d68 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -110,6 +110,7 @@ class User < ActiveRecord::Base
has_many :notes, dependent: :destroy, foreign_key: :author_id
has_many :merge_requests, dependent: :destroy, foreign_key: :author_id
has_many :events, dependent: :destroy, foreign_key: :author_id, class_name: "Event"
+ has_many :subscriptions, dependent: :destroy
has_many :recent_events, -> { order "id DESC" }, foreign_key: :author_id, class_name: "Event"
has_many :assigned_issues, dependent: :destroy, foreign_key: :assignee_id, class_name: "Issue"
has_many :assigned_merge_requests, dependent: :destroy, foreign_key: :assignee_id, class_name: "MergeRequest"