You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: index_release_schedule_change.rb
    path of file: ./repos/workarea/core/app/workers/workarea
    
    the code of the file until where you have to start completion: module Workarea
  class IndexReleaseScheduleChange
    include Sidekiq::Worker
    include Sidekiq::CallbacksWorker

    sidekiq_options(
      enqueue_on: {
        Release => [:save, :destroy],
        only_if: -> { publish_
    
    def perform(id, previous_publish_at, new_publish_at)
      # When destroyed, changesets for the release ID will still exist and be used to update the index
      rescheduled_release = Release.find_or_initialize_by(id: id)

      earlier, later = if rescheduled_release.persisted? && previous_publish_at.present? && new_publish_at.present?
        [previous_publish_at, new_publish_at].sort
      elsif previous_publish_at.present?
        [previous_publish_at, nil]
      else
        [new_publish_at, nil]
      end