class CsvExportWorker
  include Sidekiq::Worker

  def perform(csv_export_id)
    csv_export = CsvExport.find(csv_export_id)
    return if csv_export.sent?
    csv_export.export!
    CsvExportMailer.csv_download(csv_export).deliver
    csv_export.mark_sent!
  end
end
class CsvExportWorker
  include Sidekiq::Worker

  def perform(csv_export_id)
    csv_export = CsvExport.find(csv_export_id)
    return if csv_export.sent?
    csv_export.export!
    CsvExportMailer.csv_download(csv_export).deliver_now
    csv_export.mark_sent!
  end
end

Fix rails 4.2+ deprecated warnings for MessageDelivery.deliver()
Fix rails 4.2+ deprecated warnings for MessageDelivery.deliver()

Rails 4.2+ deprecated ActionMailer::MessageDelivery.deliver() in favor of
a split interface deliver_now() and deliver_later().

The old deliver() was plumbed through to deliver_now(). Let's just use that
directly.

empirical-core currently uses rails (4.2.5.1) per Gemfile.lock.

This fixes the following warnings in Travis-CI:

  DEPRECATION WARNING: `#deliver` is deprecated and will be removed in
  Rails 5. Use `#deliver_now` to deliver immediately or `#deliver_later`
  to deliver through Active Job. (called from perform at
  /home/usera/Coding/empirical-core/app/workers/csv_export_worker.rb:8)

See:
  http://apidock.com/rails/v4.2.1/ActionMailer/MessageDelivery/deliver
  http://guides.rubyonrails.org/4_2_release_notes.html
