Sha256: 88820e940f7de818a0c75f8264329a78c193fb95a2f3830e57775da739f9c3a4

Contents?: true

Size: 1.05 KB

Versions: 28

Compression:

Stored size: 1.05 KB

Contents

require_dependency "renalware/pd"
require "document/base"

module Renalware
  module PD
    class TrainingSession < ApplicationRecord
      include Accountable
      include PatientScope
      include OrderedScope
      include Document::Base
      extend Enumerize

      belongs_to :patient, class_name: "Renalware::PD::Patient", touch: true
      belongs_to :training_site, class_name: "Renalware::PD::TrainingSite"
      belongs_to :training_type, class_name: "Renalware::PD::TrainingType"

      attr_reader :ignore_me # see html form for explanation of this non-persistent attribute

      validates :training_site_id, presence: true
      validates :training_type_id, presence: true

      class Document < Document::Embedded
        attribute :started_on, Date
        attribute :trainer, String
        attribute :training_duration, String
        attribute :outcome, ::Document::Enum, enums: %i(successful limited_success unsuccessful)
        attribute :training_comments

        validates :started_on, presence: true
      end
      has_document
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
renalware-core-2.0.8 app/models/renalware/pd/training_session.rb
renalware-core-2.0.7 app/models/renalware/pd/training_session.rb
renalware-core-2.0.5 app/models/renalware/pd/training_session.rb
renalware-core-2.0.4 app/models/renalware/pd/training_session.rb
renalware-core-2.0.3 app/models/renalware/pd/training_session.rb
renalware-core-2.0.2 app/models/renalware/pd/training_session.rb
renalware-core-2.0.1 app/models/renalware/pd/training_session.rb
renalware-core-2.0.0 app/models/renalware/pd/training_session.rb
renalware-core-2.0.0.pre.rc13 app/models/renalware/pd/training_session.rb
renalware-core-2.0.0.pre.rc11 app/models/renalware/pd/training_session.rb
renalware-core-2.0.0.pre.rc10 app/models/renalware/pd/training_session.rb
renalware-core-2.0.0.pre.rc9 app/models/renalware/pd/training_session.rb
renalware-core-2.0.0.pre.rc8 app/models/renalware/pd/training_session.rb
renalware-core-2.0.0.pre.rc7 app/models/renalware/pd/training_session.rb
renalware-core-2.0.0.pre.rc6 app/models/renalware/pd/training_session.rb
renalware-core-2.0.0.pre.rc5 app/models/renalware/pd/training_session.rb
renalware-core-2.0.0.pre.rc4 app/models/renalware/pd/training_session.rb
renalware-core-2.0.0.pre.rc3 app/models/renalware/pd/training_session.rb
renalware-core-2.0.0.pre.rc1 app/models/renalware/pd/training_session.rb
renalware-core-2.0.0.pre.beta12 app/models/renalware/pd/training_session.rb