Sha256: de03cb69421c4640b339ac697ad80dab1fda61ae0de0a51a53ab4590d7bc9fb3

Contents?: true

Size: 1.08 KB

Versions: 149

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

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

149 entries across 149 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/models/renalware/pd/training_session.rb
renalware-core-2.1.0 app/models/renalware/pd/training_session.rb
renalware-core-2.0.167 app/models/renalware/pd/training_session.rb
renalware-core-2.0.166 app/models/renalware/pd/training_session.rb
renalware-core-2.0.165 app/models/renalware/pd/training_session.rb
renalware-core-2.0.164 app/models/renalware/pd/training_session.rb
renalware-core-2.0.163 app/models/renalware/pd/training_session.rb
renalware-core-2.0.162 app/models/renalware/pd/training_session.rb
renalware-core-2.0.161 app/models/renalware/pd/training_session.rb
renalware-core-2.0.160 app/models/renalware/pd/training_session.rb
renalware-core-2.0.159 app/models/renalware/pd/training_session.rb
renalware-core-2.0.158 app/models/renalware/pd/training_session.rb
renalware-core-2.0.157 app/models/renalware/pd/training_session.rb
renalware-core-2.0.156 app/models/renalware/pd/training_session.rb
renalware-core-2.0.155 app/models/renalware/pd/training_session.rb
renalware-core-2.0.153 app/models/renalware/pd/training_session.rb
renalware-core-2.0.152 app/models/renalware/pd/training_session.rb
renalware-core-2.0.151 app/models/renalware/pd/training_session.rb
renalware-core-2.0.149 app/models/renalware/pd/training_session.rb
renalware-core-2.0.148 app/models/renalware/pd/training_session.rb