Sha256: d31d996d26b137e1790e605e834ccc53cfb0c7f7ad8db44715ba77e3ae16332e
Contents?: true
Size: 864 Bytes
Versions: 38
Compression:
Stored size: 864 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/modalities" module Renalware module Modalities class Description < ApplicationRecord acts_as_paranoid validates :name, presence: true, uniqueness: true def to_s name end def to_sym nil end def self.policy_class Modalities::DescriptionPolicy end # Modalities::Description subclasses can override this to for instance add # the patient's 'HD Site' add after 'HD' def augmented_name_for(_patient) name end # For a ModalityDescription with type Renalware::HD::ModalityDescription # this will return "HD" def namespace return if type.blank? type.gsub("::", "").gsub(/^Renalware/, "").gsub(/ModalityDescription$/, "").underscore end end end end
Version data entries
38 entries across 38 versions & 1 rubygems