summaryrefslogtreecommitdiff
path: root/app/models/subscription.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-10-31 16:36:28 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-11-17 15:10:12 -0200
commitbde0202693508aa9eb3ce76876b1c64120d51ef3 (patch)
treee7844d9b4f3756bfdaa84a4ef334990f49bd5781 /app/models/subscription.rb
parent731946bad2df5b2b369db53d965061d71bf6be77 (diff)
downloadgitlab-ce-bde0202693508aa9eb3ce76876b1c64120d51ef3.tar.gz
Add unique index to subscriptions on subscribable and user and project
Diffstat (limited to 'app/models/subscription.rb')
-rw-r--r--app/models/subscription.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/subscription.rb b/app/models/subscription.rb
index f77aec0cacf..f881d999384 100644
--- a/app/models/subscription.rb
+++ b/app/models/subscription.rb
@@ -5,7 +5,7 @@ class Subscription < ActiveRecord::Base
validates :user, :project, :subscribable, presence: true
- validates :user_id,
- uniqueness: { scope: [:subscribable_id, :subscribable_type] },
+ validates :project_id,
+ uniqueness: { scope: [:subscribable_id, :subscribable_type, :user_id] },
presence: true
end