diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-10-31 16:36:28 -0200 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-11-17 15:10:12 -0200 |
commit | bde0202693508aa9eb3ce76876b1c64120d51ef3 (patch) | |
tree | e7844d9b4f3756bfdaa84a4ef334990f49bd5781 /app/models/subscription.rb | |
parent | 731946bad2df5b2b369db53d965061d71bf6be77 (diff) | |
download | gitlab-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.rb | 4 |
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 |