leikind/wice_grid — Issue #63: Delayed::Job: How to enqueue export
Author: tomkurt
Created: 2011-12-29 17:13:57+00:00
State: open

Is it possible to extract ar_options from wice grid without triggering the "all"-query?

Then I could do something like
```ruby

class ProductsController
class ExportJob < Struct.new(:ar_option)
def perform
ProductMailer.send_products(Product.find(ar_options).to_csv)
end
end

def index
@grid initialize_grid(Product)
if @grid.output_csv?
@grid.render_partial_without_fetching_records
Delayed::Job.enqueue(ExportJob.new(@grid.ar_options))
end
end
```