summaryrefslogtreecommitdiff
path: root/app/models/sent_notification.rb
diff options
context:
space:
mode:
authorMario de la Ossa <mariodelaossa@gmail.com>2018-05-03 15:32:20 -0600
committerMario de la Ossa <mariodelaossa@gmail.com>2018-05-07 12:58:47 -0600
commit02741ca4c58c625070d06c248125b2f510ac2c0b (patch)
tree3bfc7684b2082ee73ceffc85868ef3dc2d307a21 /app/models/sent_notification.rb
parent33e78f9ebd35b4132e9f18057f517d92cbefb9cd (diff)
downloadgitlab-ce-02741ca4c58c625070d06c248125b2f510ac2c0b.tar.gz
Backport 5480-epic-notifications from EE
Diffstat (limited to 'app/models/sent_notification.rb')
-rw-r--r--app/models/sent_notification.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/sent_notification.rb b/app/models/sent_notification.rb
index 6e311806be1..3da7c301d28 100644
--- a/app/models/sent_notification.rb
+++ b/app/models/sent_notification.rb
@@ -5,14 +5,14 @@ class SentNotification < ActiveRecord::Base
belongs_to :noteable, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
belongs_to :recipient, class_name: "User"
- validates :project, :recipient, presence: true
+ validates :recipient, presence: true
validates :reply_key, presence: true, uniqueness: true
validates :noteable_id, presence: true, unless: :for_commit?
validates :commit_id, presence: true, if: :for_commit?
validates :in_reply_to_discussion_id, format: { with: /\A\h{40}\z/, allow_nil: true }
validate :note_valid
- after_save :keep_around_commit
+ after_save :keep_around_commit, if: :for_commit?
class << self
def reply_key