app/workers/seasonal_offers_worker.rb
# check paused seasonal offers and create AsanaTask 30 days in advance
check paused seasonal offers and create AsanaTask 30 days in advance
check paused seasonal offers and create AsanaTask 30 days in advance
def process_paused_offers
    asana = AsanaCommunicator.new
    Offer.where(aasm_state: 'paused').find_each do |paused_offer|
      if (Time.zone.now + 30.days).to_date == paused_offer.starts_at.to_date
        asana.create_seasonal_offer_ready_for_checkup_task paused_offer
      end
    end
  end
def process_paused_offers asana = AsanaCommunicator . new Offer . where ( aasm_state : 'paused' ) . find_each do | paused_offer | if ( Time . zone . now + 30 . days ) . to_date == paused_offer . starts_at . to_date asana . create_seasonal_offer_ready_for_checkup_task paused_offer end end end
check paused seasonal offers and create AsanaTask 30 days in advance
check paused seasonal offers and create AsanaTask 30 days in advance