summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/note.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/note.rb b/app/models/note.rb
index 2cf3fac2def..324ebfda383 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -238,9 +238,9 @@ class Note < ActiveRecord::Base
def cross_reference_exists?(noteable, mentioner)
gfm_reference = mentioner_gfm_ref(noteable, mentioner)
notes = if noteable.is_a?(Commit)
- where(commit_id: noteable.id)
+ where(commit_id: noteable.id, noteable_type: 'Commit')
else
- where(noteable_id: noteable.id)
+ where(noteable_id: noteable.id, noteable_type: noteable.class)
end
notes.where('note like ?', cross_reference_note_pattern(gfm_reference)).