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: 20190312184823_adjust_on_slip_expires_at.rb
    path of file: ./repos/catarse/db/migrate
    
    the code of the file until where you have to start completion: class AdjustOnSlipExpiresAt < ActiveRecord::Migration
  def up
    execute <<-SQL
create or replace function slip_expires_at(payments) returns t
    
  def up
    execute <<-SQL
create or replace function slip_expires_at(payments) returns timestamp without time zone
  stable
  language sql
as
$$
SELECT weekdays_from(public.slip_expiration_weekdays(), public.zone_timestamp(coalesce(($1.gateway_data->>'boleto_expiration_date'::text)::timestamp, $1.created_at)))::date + 1 - '1 second'::interval;
$$;
    SQL
  end