Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
f665e5b8
Commit
f665e5b8
authored
Jul 18, 2018
by
Jan Provaznik
Committed by
Sean McGivern
Jul 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix serialization of LegacyDiffNote
parent
11deffa3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
changelogs/unreleased/fix-diff-note.yml
changelogs/unreleased/fix-diff-note.yml
+5
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-1
spec/factories/notes.rb
spec/factories/notes.rb
+1
-0
No files found.
changelogs/unreleased/fix-diff-note.yml
0 → 100644
View file @
f665e5b8
---
title
:
Fix serialization of LegacyDiffNote
merge_request
:
author
:
type
:
fixed
lib/api/entities.rb
View file @
f665e5b8
...
...
@@ -701,7 +701,7 @@ module API
expose
:system?
,
as: :system
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
end
...
...
spec/factories/notes.rb
View file @
f665e5b8
...
...
@@ -39,6 +39,7 @@ FactoryBot.define do
factory
:legacy_diff_note_on_merge_request
,
traits:
[
:on_merge_request
,
:legacy_diff_note
],
class:
LegacyDiffNote
do
association
:project
,
:repository
position
''
end
factory
:diff_note_on_merge_request
,
traits:
[
:on_merge_request
],
class:
DiffNote
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment