Class: Tire::Model::Import::Strategy::Kaminari
- Inherits:
-
Object
- Object
- Tire::Model::Import::Strategy::Kaminari
- Includes:
- Base
- Defined in:
- lib/tire/model/import.rb
Instance Attribute Summary
Attributes included from Base
Instance Method Summary collapse
Methods included from Base
Instance Method Details
#import(&block) ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/tire/model/import.rb', line 84 def import &block current = 0 page = 1 while current < klass.count items = klass.page(page).per([:per_page]) index.import items, , &block current = current + items.size page += 1 end self end |