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.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/models/service_list.rb b/app/models/service_list.rb
index fa3760f0c56..9cbc5e68059 100644
--- a/app/models/service_list.rb
+++ b/app/models/service_list.rb
@@ -1,10 +1,10 @@
# frozen_string_literal: true
class ServiceList
- def initialize(batch, service_hash, extra_hash = {})
- @batch = batch
+ def initialize(batch_ids, service_hash, association)
+ @batch_ids = batch_ids
@service_hash = service_hash
- @extra_hash = extra_hash
+ @association = association
end
def to_array
@@ -13,15 +13,15 @@ class ServiceList
private
- attr_reader :batch, :service_hash, :extra_hash
+ attr_reader :batch_ids, :service_hash, :association
def columns
- (service_hash.keys << 'project_id') + extra_hash.keys
+ (service_hash.keys << "#{association}_id")
end
def values
- batch.map do |project_id|
- (service_hash.values << project_id) + extra_hash.values
+ batch_ids.map do |id|
+ (service_hash.values << id)
end
end
end