demarches-normaliennes/app/models/attestation.rb

12 lines
212 B
Ruby
Raw Normal View History

2017-06-02 14:30:26 +02:00
class Attestation < ApplicationRecord
belongs_to :dossier, optional: false
2017-06-02 14:30:26 +02:00
2019-08-28 13:11:58 +02:00
has_one_attached :pdf
2019-07-31 16:09:28 +02:00
def pdf_url
2019-08-28 13:11:58 +02:00
if pdf.attached?
Rails.application.routes.url_helpers.url_for(pdf)
2019-07-31 16:09:28 +02:00
end
end
2017-06-02 14:30:26 +02:00
end