summaryrefslogtreecommitdiff
path: root/db/post_migrate/20180216121030_enqueue_verify_pages_domain_workers.rb
blob: bf9bf4e660f7ca13c10e1d3e46ae697910fd194d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class EnqueueVerifyPagesDomainWorkers < ActiveRecord::Migration
  class PagesDomain < ActiveRecord::Base
    include EachBatch
  end

  def up
    PagesDomain.each_batch do |relation|
      ids = relation.pluck(:id).map { |id| [id] }
      PagesDomainVerificationWorker.bulk_perform_async(ids)
    end
  end

  def down
    # no-op
  end
end