Files
old-holivud2/app/models/concerns/amendmenable.rb

32 lines
649 B
Ruby
Raw Normal View History

2020-07-21 22:09:08 +02:00
module Amendmenable
extend ActiveSupport::Concern
included do
include ActiveStorageSupport::SupportForBase64
has_one_base64_attached :amendment_signature
end
def amendment_signable?
2020-07-21 22:39:55 +02:00
if contract_template.present?
contract_template.amendment_clause.present?
else
false
end
2020-07-21 22:09:08 +02:00
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