Class: Tire::Model::Import::Strategy::WillPaginate
- Inherits:
-
Object
- Object
- Tire::Model::Import::Strategy::WillPaginate
- 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
99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/tire/model/import.rb', line 99 def import &block current = 0 page = 1 while current < klass.count items = klass.paginate(:page => page, :per_page => [:per_page]) index.import items, , &block current += items.size page += 1 end self end |