implement amendment signing

This commit is contained in:
Bilal
2020-07-21 22:09:08 +02:00
parent 8d16c310df
commit 141ab42d4b
13 changed files with 152 additions and 4 deletions

View File

@@ -0,0 +1,27 @@
module Amendmenable
extend ActiveSupport::Concern
included do
include ActiveStorageSupport::SupportForBase64
has_one_base64_attached :amendment_signature
end
def amendment_signable?
contract_template.amendment_clause.present?
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