Class: Validb::ModelValidator

Inherits:
Object
  • Object
show all
Includes:
SidekiqStatus::Worker
Defined in:
lib/validb/model_validator.rb

Instance Method Summary collapse

Instance Method Details

#perform(model_name, batch_size) ⇒ Object



5
6
7
8
9
10
# File 'lib/validb/model_validator.rb', line 5

def perform(model_name, batch_size)
  model_name.constantize.select(:id).find_in_batches(batch_size: batch_size) do |record_batch|
    model_ids = record_batch.map(&:id)
    Validb::Batcher.perform_async(model_name, model_ids)
  end
end