diff options
author | micael.bergeron <micaelbergeron@gmail.com> | 2017-11-16 09:23:32 -0500 |
---|---|---|
committer | micael.bergeron <micaelbergeron@gmail.com> | 2017-11-16 09:23:32 -0500 |
commit | 71b2cc1dd8497959306601eece8ebbf008562d07 (patch) | |
tree | 0d77ad873a4f3141989bce09756e7fdc201b03df /app/models/note.rb | |
parent | 160324d08b3756f6c5fbf79b23f09d66e5a19d9e (diff) | |
download | gitlab-ce-71b2cc1dd8497959306601eece8ebbf008562d07.tar.gz |
reverting to the simpler approach
Diffstat (limited to 'app/models/note.rb')
-rw-r--r-- | app/models/note.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/app/models/note.rb b/app/models/note.rb index f9676361072..4bbb54ba9bf 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -169,7 +169,13 @@ class Note < ActiveRecord::Base end def cross_reference? - system? && matches_cross_reference_regex? + return unless system? + + if force_cross_reference_regex_check? + matches_cross_reference_regex? + else + SystemNoteService.cross_reference?(note) + end end def diff_note? @@ -382,4 +388,10 @@ class Note < ActiveRecord::Base def set_discussion_id self.discussion_id ||= discussion_class.discussion_id(self) end + + def force_cross_reference_regex_check? + return unless system? + + SystemNoteMetadata::TYPES_WITH_CROSS_REFERENCES.include?(system_note_metadata&.action) + end end |