Class: ScheduleWorkers::ExpiredAdaptivePointsRatio

Inherits:
ApplicationWorker show all
Defined in:
app/workers/schedule_workers/expired_adaptive_points_ratio.rb

Instance Method Summary collapse

Methods inherited from ApplicationWorker

unlimited_retry

Instance Method Details

#performObject



7
8
9
10
11
12
# File 'app/workers/schedule_workers/expired_adaptive_points_ratio.rb', line 7

def perform
  current_date = Time.thai_time.to_date
  expired_adaptive_points_ratios =
    ::AdaptivePointsRatio.where('is_active IS TRUE AND end_date < ?', current_date)
  expired_adaptive_points_ratios.update_all(is_active: false)
end