class AttachContractToReleasableJob < ApplicationJob
  queue_as :default

  def perform(releasable)
    contract = Contract.new(releasable)

    releasable.contract.attach({
      io: contract.to_pdf, 
      filename: contract.filename, 
      content_type: "application/pdf"
    })
  end
end
