From 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 17 Dec 2020 11:59:07 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-7-stable-ee --- app/models/diff_note.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/models/diff_note.rb') diff --git a/app/models/diff_note.rb b/app/models/diff_note.rb index 4b2e62bf761..944a64f5419 100644 --- a/app/models/diff_note.rb +++ b/app/models/diff_note.rb @@ -19,7 +19,7 @@ class DiffNote < Note # EE might have added a type when the module was prepended validates :noteable_type, inclusion: { in: -> (_note) { noteable_types } } validate :positions_complete - validate :verify_supported + validate :verify_supported, unless: :importing? before_validation :set_line_code, if: :on_text?, unless: :importing? after_save :keep_around_commits, unless: :importing? @@ -149,7 +149,7 @@ class DiffNote < Note end def supported? - for_commit? || for_design? || self.noteable.has_complete_diff_refs? + for_commit? || for_design? || self.noteable&.has_complete_diff_refs? end def set_line_code -- cgit v1.2.3