summaryrefslogtreecommitdiff
path: root/app/models/note.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-04-15 19:10:05 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-04-16 16:30:15 -0400
commit2dace3679fb9a086a015dcca213c6e563a08764e (patch)
treef6d8fbc7f6449f598097ceb7e3ad90f21aa386ec /app/models/note.rb
parente24ed47f8fdcb846badcc5b38846ddf67a474ad1 (diff)
downloadgitlab-ce-2dace3679fb9a086a015dcca213c6e563a08764e.tar.gz
Note#cross_reference_exists? should be checking the noteable_type also
Diffstat (limited to 'app/models/note.rb')
-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)).