Sha256: 831275b045e58408489c0e9eb381af3f6421454c217b41ec5db08dfaeb768be4
Contents?: true
Size: 738 Bytes
Versions: 11
Compression:
Stored size: 738 Bytes
Contents
require_dependency "renalware/letters" module Renalware module Letters class ApproveLetter class << self alias_method :build, :new end def initialize(letter) @letter = letter end def call(by:) Letter.transaction do sign(by: by) archive_content(by: by) archive_recipients end end def sign(by:) # Needs to be saved before changing the STI type # (signature would be lost otherwise) @letter.sign(by: by).save! end def archive_content(by:) @letter.generate_archive(by: by).save! end def archive_recipients @letter.archive_recipients! end end end end
Version data entries
11 entries across 11 versions & 1 rubygems