Class: Renalware::Letters::ApproveLetter
- Inherits:
-
Object
- Object
- Renalware::Letters::ApproveLetter
- Includes:
- Broadcasting
- Defined in:
- app/models/renalware/letters/approve_letter.rb
Instance Method Summary collapse
Methods included from Broadcasting
#broadcasting_to_configured_subscribers
Instance Method Details
#call(by:) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/models/renalware/letters/approve_letter.rb', line 16 def call(by:) Letter.transaction do add_missing_counterpart_cc_recipients archive_recipients sign(by: by) archive_content(by: by) # Cast the letter to the base Letter class in case it becomes a Letters::Completed # before any async listeners have time to process it. broadcast(:letter_approved, letter.becomes(Letters::Letter)) end end |