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
Jérome Perrin
gitlab-ce
Commits
e5f91e52
Commit
e5f91e52
authored
Sep 06, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor code based on feedback
parent
89ca01eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
app/models/ci/build.rb
app/models/ci/build.rb
+1
-1
lib/gitlab/import_export/project_tree_restorer.rb
lib/gitlab/import_export/project_tree_restorer.rb
+1
-3
No files found.
app/models/ci/build.rb
View file @
e5f91e52
...
@@ -452,7 +452,7 @@ module Ci
...
@@ -452,7 +452,7 @@ module Ci
end
end
def
serializable_hash
(
options
=
{})
def
serializable_hash
(
options
=
{})
super
(
options
.
merge
(
when:
read_attribute
(
:when
)
))
super
(
options
).
merge
(
when:
read_attribute
(
:when
))
end
end
private
private
...
...
lib/gitlab/import_export/project_tree_restorer.rb
View file @
e5f91e52
...
@@ -53,11 +53,9 @@ module Gitlab
...
@@ -53,11 +53,9 @@ module Gitlab
# Finally, it updates each attribute in the newly imported project.
# Finally, it updates each attribute in the newly imported project.
def
create_relations
def
create_relations
default_relation_list
.
each
do
|
relation
|
default_relation_list
.
each
do
|
relation
|
next
unless
relation
.
is_a?
(
Hash
)
||
@tree_hash
[
relation
.
to_s
].
present?
if
relation
.
is_a?
(
Hash
)
if
relation
.
is_a?
(
Hash
)
create_sub_relations
(
relation
,
@tree_hash
)
create_sub_relations
(
relation
,
@tree_hash
)
els
e
els
if
@tree_hash
[
relation
.
to_s
].
present?
relation_key
=
relation
.
is_a?
(
Hash
)
?
relation
.
keys
.
first
:
relation
relation_key
=
relation
.
is_a?
(
Hash
)
?
relation
.
keys
.
first
:
relation
save_relation_hash
(
@tree_hash
[
relation_key
.
to_s
],
relation_key
)
save_relation_hash
(
@tree_hash
[
relation_key
.
to_s
],
relation_key
)
end
end
...
...
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