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
a359d510
Commit
a359d510
authored
Sep 07, 2020
by
Arturo Herrero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove extra_hash variable
This information is already included as part of the service_hash.
parent
edccbcb6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
app/models/service_list.rb
app/models/service_list.rb
+4
-5
app/services/admin/propagate_integration_service.rb
app/services/admin/propagate_integration_service.rb
+1
-1
No files found.
app/models/service_list.rb
View file @
a359d510
# frozen_string_literal: true
class
ServiceList
def
initialize
(
batch
,
service_hash
,
extra_hash
=
{}
)
def
initialize
(
batch
,
service_hash
)
@batch
=
batch
@service_hash
=
service_hash
@extra_hash
=
extra_hash
end
def
to_array
...
...
@@ -13,15 +12,15 @@ class ServiceList
private
attr_reader
:batch
,
:service_hash
,
:extra_hash
attr_reader
:batch
,
:service_hash
def
columns
(
service_hash
.
keys
<<
'project_id'
)
+
extra_hash
.
keys
(
service_hash
.
keys
<<
'project_id'
)
end
def
values
batch
.
map
do
|
project_id
|
(
service_hash
.
values
<<
project_id
)
+
extra_hash
.
values
(
service_hash
.
values
<<
project_id
)
end
end
end
app/services/admin/propagate_integration_service.rb
View file @
a359d510
...
...
@@ -61,7 +61,7 @@ module Admin
end
def
bulk_create_from_integration
(
batch
)
service_list
=
ServiceList
.
new
(
batch
,
service_hash
,
{
'inherit_from_id'
=>
integration
.
id
}
).
to_array
service_list
=
ServiceList
.
new
(
batch
,
service_hash
).
to_array
Project
.
transaction
do
results
=
bulk_insert
(
*
service_list
)
...
...
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