Skip to content

Instantly share code, notes, and snippets.

class MarkObsoleteAppointmentsJobConsole
BATCH_SIZE = 100
def perform
latest_end_at = LastObsolete.first.end_at
logger = Logger.new("log/#{Rails.env}-obsolete.log")
appointments = Appointment.
from("appointments FORCE INDEX (index_appointments_on_end_at)").
includes(:appointment_contexts, :appointment_invitations, :appointment_associations).