summaryrefslogtreecommitdiff
path: root/app/models/subscription.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-11-14 20:42:22 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-11-17 15:10:13 -0200
commit0aac2e0706cd767993148826d723aa3641cbb2a4 (patch)
treed3f1708529146be7d3f27fd2227c96068062f37a /app/models/subscription.rb
parent346f58249242c0ccf278175c78fc000976912771 (diff)
downloadgitlab-ce-0aac2e0706cd767993148826d723aa3641cbb2a4.tar.gz
Allow subscriptions to be created without a project
Diffstat (limited to 'app/models/subscription.rb')
-rw-r--r--app/models/subscription.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/models/subscription.rb b/app/models/subscription.rb
index f881d999384..17869c8bac2 100644
--- a/app/models/subscription.rb
+++ b/app/models/subscription.rb
@@ -3,9 +3,7 @@ class Subscription < ActiveRecord::Base
belongs_to :project
belongs_to :subscribable, polymorphic: true
- validates :user, :project, :subscribable, presence: true
+ validates :user, :subscribable, presence: true
- validates :project_id,
- uniqueness: { scope: [:subscribable_id, :subscribable_type, :user_id] },
- presence: true
+ validates :project_id, uniqueness: { scope: [:subscribable_id, :subscribable_type, :user_id] }
end