Commit 1fe6405a authored by Sean McGivern's avatar Sean McGivern

Merge branch 'jprovazn-fix-diff-note' into 'master'

Fix serialization of LegacyDiffNote

Closes #49355

See merge request gitlab-org/gitlab-ce!20685
parents 11deffa3 f665e5b8
---
title: Fix serialization of LegacyDiffNote
merge_request:
author:
type: fixed
...@@ -701,7 +701,7 @@ module API ...@@ -701,7 +701,7 @@ module API
expose :system?, as: :system expose :system?, as: :system
expose :noteable_id, :noteable_type expose :noteable_id, :noteable_type
expose :position, if: ->(note, options) { note.diff_note? } do |note| expose :position, if: ->(note, options) { note.is_a?(DiffNote) } do |note|
note.position.to_h note.position.to_h
end end
......
...@@ -39,6 +39,7 @@ FactoryBot.define do ...@@ -39,6 +39,7 @@ FactoryBot.define do
factory :legacy_diff_note_on_merge_request, traits: [:on_merge_request, :legacy_diff_note], class: LegacyDiffNote do factory :legacy_diff_note_on_merge_request, traits: [:on_merge_request, :legacy_diff_note], class: LegacyDiffNote do
association :project, :repository association :project, :repository
position ''
end end
factory :diff_note_on_merge_request, traits: [:on_merge_request], class: DiffNote do factory :diff_note_on_merge_request, traits: [:on_merge_request], class: DiffNote do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment