Sha256: 59396ce645c8d8dfcdfa783b2de3b1059c0c754c7666d0a1e9d730f0b747630a

Contents?: true

Size: 592 Bytes

Versions: 43

Compression:

Stored size: 592 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/admissions"

module Renalware
  module Admissions
    class Request < ApplicationRecord
      include Accountable
      extend Enumerize

      acts_as_paranoid

      belongs_to :patient, touch: true
      belongs_to :reason, class_name: "RequestReason"

      validates :patient_id, presence: true, uniqueness: true
      validates :reason_id, presence: true
      validates :priority, presence: true

      enumerize :priority, in: %i(low medium high urgent)

      scope :ordered, ->{ order(position: :asc) }
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
renalware-core-2.0.55 app/models/renalware/admissions/request.rb
renalware-core-2.0.54 app/models/renalware/admissions/request.rb
renalware-core-2.0.53 app/models/renalware/admissions/request.rb
renalware-core-2.0.52 app/models/renalware/admissions/request.rb
renalware-core-2.0.51 app/models/renalware/admissions/request.rb
renalware-core-2.0.50 app/models/renalware/admissions/request.rb
renalware-core-2.0.48 app/models/renalware/admissions/request.rb
renalware-core-2.0.47 app/models/renalware/admissions/request.rb
renalware-core-2.0.46 app/models/renalware/admissions/request.rb
renalware-core-2.0.45 app/models/renalware/admissions/request.rb
renalware-core-2.0.44 app/models/renalware/admissions/request.rb
renalware-core-2.0.43 app/models/renalware/admissions/request.rb
renalware-core-2.0.42 app/models/renalware/admissions/request.rb
renalware-core-2.0.41 app/models/renalware/admissions/request.rb
renalware-core-2.0.40 app/models/renalware/admissions/request.rb
renalware-core-2.0.39 app/models/renalware/admissions/request.rb
renalware-core-2.0.38 app/models/renalware/admissions/request.rb
renalware-core-2.0.37 app/models/renalware/admissions/request.rb
renalware-core-2.0.36 app/models/renalware/admissions/request.rb
renalware-core-2.0.35 app/models/renalware/admissions/request.rb