Sha256: 4af74fd5bc43ce085897654b1eb550d86ec01e2881cd6130e2b429fd948a6271
Contents?: true
Size: 724 Bytes
Versions: 1
Compression:
Stored size: 724 Bytes
Contents
require_dependency "renalware/hospitals" module Renalware module Hospitals class Unit < ApplicationRecord extend Enumerize belongs_to :hospital_centre, class_name: "Hospitals::Centre" validates :hospital_centre, presence: true validates :unit_code, presence: true validates :name, presence: true validates :renal_registry_code, presence: true validates :unit_type, presence: true enumerize :unit_type, in: %i(hospital satellite home) scope :ordered, -> { order(:name) } scope :hd_sites, -> { where(is_hd_site: true) } def self.policy_class BasePolicy end def to_s "#{name} (#{unit_code})" end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
renalware-core-2.0.0.pre.beta4 | app/models/renalware/hospitals/unit.rb |