Class: Tire::Model::Import::Strategy::ActiveRecord

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/tire/model/import.rb

Instance Attribute Summary

Attributes included from Base

#index, #klass, #options

Instance Method Summary collapse

Methods included from Base

#initialize

Instance Method Details

#import(&block) ⇒ Object



58
59
60
61
62
63
# File 'lib/tire/model/import.rb', line 58

def import &block
  klass.find_in_batches(:batch_size => options[:per_page]) do |batch|
    index.import batch, options, &block
  end
  self
end