summaryrefslogtreecommitdiff
path: root/db/post_migrate/20180216121030_enqueue_verify_pages_domain_workers.rb
blob: d776fb85f00f982ca94aa8807e634889df315b8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class EnqueueVerifyPagesDomainWorkers < ActiveRecord::Migration[4.2]
  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