Sha256: e6a4917c6aa811844c8c18d839dec8b3c5c4bac1c20e0bba0c9066181183ca98

Contents?: true

Size: 918 Bytes

Versions: 16

Compression:

Stored size: 918 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/clinical"
require "document/base"

module Renalware
  module Clinical
    class DryWeight < ApplicationRecord
      include PatientScope
      include Accountable

      belongs_to :patient, class_name: "Renalware::Clinical::Patient", touch: true
      belongs_to :assessor, class_name: "User", foreign_key: "assessor_id"

      has_paper_trail class_name: "Renalware::Clinical::Version", on: [:create, :update, :destroy]

      scope :ordered, -> { order(assessed_on: :desc, created_at: :desc) }

      validates :patient, presence: true
      validates :assessor, presence: true
      validates :weight, presence: true, "renalware/patients/weight" => true
      validates :assessed_on, presence: true
      validates :assessed_on, timeliness: { type: :date, allow_blank: false }

      def self.policy_class
        BasePolicy
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
renalware-core-2.0.64 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.63 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.62 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.61 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.60 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.58 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.57 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.56 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.55 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.54 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.53 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.52 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.51 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.50 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.48 app/models/renalware/clinical/dry_weight.rb
renalware-core-2.0.47 app/models/renalware/clinical/dry_weight.rb