Files
old-holivud2/app/models/concerns/amendmenable.rb
Bilal eefc991207 fix
2020-07-22 19:18:05 +02:00

32 lines
649 B
Ruby

module Amendmenable
extend ActiveSupport::Concern
included do
include ActiveStorageSupport::SupportForBase64
has_one_base64_attached :amendment_signature
end
def amendment_signable?
if contract_template.present?
contract_template.amendment_clause.present?
else
false
end
end
def amendment_signed?
amendment_signature.attached?
end
def amendment_signature_base64
nil
end
def amendment_signature_base64=(data_uri)
return if data_uri.blank?
amendment_signature.attach(data: data_uri, filename: "amendment_signature.png", content_type: "image/png", identify: "false")
end
end