class VaccinationRecordsController
Public Instance Methods
Source
# File app/controllers/vaccination_records_controller.rb, line 27 def confirm_destroy authorize @vaccination_record, :destroy? render :destroy end
Source
# File app/controllers/vaccination_records_controller.rb, line 32 def destroy authorize @vaccination_record @vaccination_record.discard! PatientStatusUpdater.call(patient: @vaccination_record.patient) if @vaccination_record.confirmation_sent? @vaccination_record.notifier.send_deletion(sent_by: current_user) end PatientStatusUpdater.call(patient: @vaccination_record.patient) redirect_to @return_to, flash: { success: "Vaccination record archived" } end
Source
# File app/controllers/vaccination_records_controller.rb, line 11 def update draft_vaccination_record = DraftVaccinationRecord.new(request_session: session, current_user:) # TODO: Refactor this so that we don't need to clear out the attributes from # the draft record(s) in this use case. This likely means changing # RequestSessionPersistable to do this clearing out. One possible # approach would be to change `new` to instantiate without loading # values from the session, and adding `new_from_session` to replace # the existing functionality in `new`. draft_vaccination_record.clear! draft_vaccination_record.clear_changes_information draft_vaccination_record.read_from!(@vaccination_record) redirect_to draft_vaccination_record_path("confirm") end