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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
1e99b7b5
Commit
1e99b7b5
authored
Mar 25, 2020
by
nmilojevic1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for project_members array
parent
f1dd55e8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
lib/gitlab/import_export/json/streaming_serializer.rb
lib/gitlab/import_export/json/streaming_serializer.rb
+10
-0
No files found.
lib/gitlab/import_export/json/streaming_serializer.rb
View file @
1e99b7b5
...
...
@@ -47,6 +47,8 @@ module Gitlab
record
=
exportable
.
public_send
(
key
)
# rubocop: disable GitlabSecurity/PublicSend
if
record
.
is_a?
(
ActiveRecord
::
Relation
)
serialize_many_relations
(
key
,
record
,
options
)
elsif
record
.
respond_to?
(
:each
)
# this is to support `project_members` that return an Array
serialize_many_each
(
key
,
record
,
options
)
else
serialize_single_relation
(
key
,
record
,
options
)
end
...
...
@@ -63,6 +65,14 @@ module Gitlab
end
end
def
serialize_many_each
(
key
,
records
,
options
)
records
.
each
do
|
record
|
json
=
Raw
.
new
(
record
.
to_json
(
options
))
json_writer
.
append
(
key
,
json
)
end
end
def
serialize_single_relation
(
key
,
record
,
options
)
json
=
Raw
.
new
(
record
.
to_json
(
options
))
...
...
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