Sha256: b9d93689fbdaa8181fe17a9120f0e356f43c18f4b40981b96092a4ca77a37f70

Contents?: true

Size: 493 Bytes

Versions: 3

Compression:

Stored size: 493 Bytes

Contents

require_dependency "renalware/messaging"

module Renalware
  module Messaging
    class SendMessage

      def self.call(*args)
        new.call(*args)
      end

      def call(author:, patient:, form:)
        Message.transaction do
          message = MessageFactory.build(patient: patient,
                                         author: author,
                                         **form.attributes)
          message.save!
          message
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta7 app/models/renalware/messaging/send_message.rb
renalware-core-2.0.0.pre.beta6 app/models/renalware/messaging/send_message.rb
renalware-core-2.0.0.pre.beta5 app/models/renalware/messaging/send_message.rb