Sha256: 4b8f6640588a780ad01a8e50dbc74f49c58388164d00fd21c58b0ad3a907508e
Contents?: true
Size: 781 Bytes
Versions: 62
Compression:
Stored size: 781 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/transplants" module Renalware module Transplants class RejectionEpisode < ApplicationRecord include Accountable has_paper_trail( class_name: "Renalware::Transplants::Version", on: [:create, :update, :destroy] ) belongs_to :followup, class_name: "RecipientFollowup", touch: true belongs_to :treatment, class_name: "RejectionTreatment" validates :recorded_on, presence: true validates :notes, presence: true validates :followup, presence: true, if: proc { |re| re.followup_id.blank? } validates :followup_id, presence: true, if: proc { |re| re.followup.blank? } scope :ordered, -> { order(:recorded_on, :created_at) } end end end
Version data entries
62 entries across 62 versions & 1 rubygems