Commit a359d510 authored by Arturo Herrero's avatar Arturo Herrero

Remove extra_hash variable

This information is already included as part of the service_hash.
parent edccbcb6
# 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
......@@ -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)
......
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