提交 2dace367 编写于 作者: R Robert Speicher

Note#cross_reference_exists? should be checking the noteable_type also

上级 e24ed47f
......@@ -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)).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册