demarches-normaliennes/app/models/attestation.rb
2020-08-12 11:45:53 +02:00

23 lines
509 B
Ruby

# == Schema Information
#
# Table name: attestations
#
# id :integer not null, primary key
# title :string
# created_at :datetime not null
# updated_at :datetime not null
# dossier_id :integer not null
#
class Attestation < ApplicationRecord
self.ignored_columns = ['pdf', 'content_secure_token']
belongs_to :dossier
has_one_attached :pdf
def pdf_url
if pdf.attached?
Rails.application.routes.url_helpers.url_for(pdf)
end
end
end