summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/note.rb')
-rw-r--r--app/models/note.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index 55255d22c2f..d287e0f3c6d 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -37,6 +37,8 @@ class Note < ActiveRecord::Base
belongs_to :author, class_name: "User"
belongs_to :updated_by, class_name: "User"
+ has_many :todos, dependent: :destroy
+
delegate :name, to: :project, prefix: true
delegate :name, :email, to: :author, prefix: true
@@ -375,6 +377,7 @@ class Note < ActiveRecord::Base
#
def set_award!
return unless awards_supported? && contains_emoji_only?
+
self.is_award = true
self.note = award_emoji_name
end
@@ -382,7 +385,7 @@ class Note < ActiveRecord::Base
private
def awards_supported?
- noteable.kind_of?(Issue) || noteable.is_a?(MergeRequest)
+ (noteable.kind_of?(Issue) || noteable.is_a?(MergeRequest)) && !for_diff_line?
end
def contains_emoji_only?