diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-04-15 19:10:05 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-04-16 16:30:15 -0400 |
commit | 2dace3679fb9a086a015dcca213c6e563a08764e (patch) | |
tree | f6d8fbc7f6449f598097ceb7e3ad90f21aa386ec /app/models | |
parent | e24ed47f8fdcb846badcc5b38846ddf67a474ad1 (diff) | |
download | gitlab-ce-2dace3679fb9a086a015dcca213c6e563a08764e.tar.gz |
Note#cross_reference_exists? should be checking the noteable_type also
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/note.rb | 4 |
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)). |