Sha256: c66edd112c0736efff5737bbb7b0b7e029170744257743806595e775d02e0664
Contents?: true
Size: 505 Bytes
Versions: 95
Compression:
Stored size: 505 Bytes
Contents
# frozen_string_literal: true module Renalware module Clinical class DeleteAllergy def initialize(allergy, user) @allergy = allergy @user = user end def call Allergy.transaction do patient = allergy.patient allergy.destroy if patient.allergies.count == 0 patient.update(allergy_status: :unrecorded, by: user) end end end private attr_reader :allergy, :user end end end
Version data entries
95 entries across 95 versions & 1 rubygems