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
path: root/db
diff options
context:
space:
mode:
authorRubén Dávila <ruben@gitlab.com>2017-10-05 18:17:18 +0300
committerRubén Dávila <ruben@gitlab.com>2017-10-05 18:17:18 +0300
commit5595d73763caf224df4109ab2d52e616cd843d49 (patch)
tree9de3c6d2eb1fdf0bc182fa54acc0c19ca1640802 /db
parentbd8e3606a202273129b963742aa071a0d2c8812f (diff)
Small refactor and fix for RuboCop
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20171005130944_schedule_create_gpg_key_subkeys_from_gpg_keys.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/db/post_migrate/20171005130944_schedule_create_gpg_key_subkeys_from_gpg_keys.rb b/db/post_migrate/20171005130944_schedule_create_gpg_key_subkeys_from_gpg_keys.rb
index c8bbfbccc08..08c9ce1d3bb 100644
--- a/db/post_migrate/20171005130944_schedule_create_gpg_key_subkeys_from_gpg_keys.rb
+++ b/db/post_migrate/20171005130944_schedule_create_gpg_key_subkeys_from_gpg_keys.rb
@@ -8,11 +8,13 @@ class ScheduleCreateGpgKeySubkeysFromGpgKeys < ActiveRecord::Migration
class GpgKey < ActiveRecord::Base
self.table_name = 'gpg_keys'
+
+ include EachBatch
end
def up
- GpgKey.select(:id).in_batches do |relation|
- jobs = relation.pluck(:id).map do |id|
+ GpgKey.select(:id).each_batch do |gpg_keys|
+ jobs = gpg_keys.pluck(:id).map do |id|
['CreateGpgKeySubkeysFromGpgKeys', [id]]
end