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: payment.rb
    path of file: ./repos/catarse/app/models
    
    the code of the file until where you have to start completion: # frozen_string_literal: tr
    
  def slip_expiration_date
    # If payment does not exist gives expiration date based on current_timestamp
    if id.nil?
      self.class.connection.select_one("SELECT public.weekdays_from(public.slip_expiration_weekdays(), current_timestamp::timestamp) at time zone 'America/Sao_Paulo' as weekdays_from")['weekdays_from'].try(:to_datetime)
    else
      pluck_from_database("slip_expires_at at time zone 'America/Sao_Paulo'").try(:to_datetime)
    end
  end