Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/service_list.rb')
-rw-r--r--app/models/service_list.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/models/service_list.rb b/app/models/service_list.rb
index 2a75567d5ff..9cbc5e68059 100644
--- a/app/models/service_list.rb
+++ b/app/models/service_list.rb
@@ -1,9 +1,10 @@
# frozen_string_literal: true
class ServiceList
- def initialize(batch_ids, service_hash)
+ def initialize(batch_ids, service_hash, association)
@batch_ids = batch_ids
@service_hash = service_hash
+ @association = association
end
def to_array
@@ -12,15 +13,15 @@ class ServiceList
private
- attr_reader :batch_ids, :service_hash
+ attr_reader :batch_ids, :service_hash, :association
def columns
- (service_hash.keys << 'project_id')
+ (service_hash.keys << "#{association}_id")
end
def values
- batch_ids.map do |project_id|
- (service_hash.values << project_id)
+ batch_ids.map do |id|
+ (service_hash.values << id)
end
end
end