diff options
Diffstat (limited to 'app/models/diff_note.rb')
-rw-r--r-- | app/models/diff_note.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/app/models/diff_note.rb b/app/models/diff_note.rb index e3df61dadae..ff39dbb59f3 100644 --- a/app/models/diff_note.rb +++ b/app/models/diff_note.rb @@ -9,7 +9,7 @@ class DiffNote < Note include Gitlab::Utils::StrongMemoize def self.noteable_types - %w(MergeRequest Commit) + %w(MergeRequest Commit DesignManagement::Design) end validates :original_position, presence: true @@ -60,6 +60,8 @@ class DiffNote < Note # Returns the diff file from `position` def latest_diff_file strong_memoize(:latest_diff_file) do + next if for_design? + position.diff_file(repository) end end @@ -67,6 +69,8 @@ class DiffNote < Note # Returns the diff file from `original_position` def diff_file strong_memoize(:diff_file) do + next if for_design? + enqueue_diff_file_creation_job if should_create_diff_file? fetch_diff_file @@ -145,7 +149,7 @@ class DiffNote < Note end def supported? - for_commit? || self.noteable.has_complete_diff_refs? + for_commit? || for_design? || self.noteable.has_complete_diff_refs? end def set_line_code @@ -184,5 +188,3 @@ class DiffNote < Note noteable.respond_to?(:repository) ? noteable.repository : project.repository end end - -DiffNote.prepend_if_ee('::EE::DiffNote') |