Sha256: 88be30d8534e58d9b220e4fbd66ee9366758ff827c4b91d85745db334709d208

Contents?: true

Size: 547 Bytes

Versions: 9

Compression:

Stored size: 547 Bytes

Contents

require_dependency "renalware/research"

module Renalware
  module Research
    class StudyParticipant < ApplicationRecord
      include Accountable
      acts_as_paranoid
      validates :participant_id, presence: true, uniqueness: { scope: :study }
      validates :study, presence: true
      belongs_to :study, touch: true
      belongs_to :patient,
                 class_name: "Renalware::Patient",
                 foreign_key: :participant_id,
                 touch: true

      def to_s
        patient&.to_s
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
renalware-core-2.0.8 app/models/renalware/research/study_participant.rb
renalware-core-2.0.7 app/models/renalware/research/study_participant.rb
renalware-core-2.0.5 app/models/renalware/research/study_participant.rb
renalware-core-2.0.4 app/models/renalware/research/study_participant.rb
renalware-core-2.0.3 app/models/renalware/research/study_participant.rb
renalware-core-2.0.2 app/models/renalware/research/study_participant.rb
renalware-core-2.0.1 app/models/renalware/research/study_participant.rb
renalware-core-2.0.0 app/models/renalware/research/study_participant.rb
renalware-core-2.0.0.pre.rc13 app/models/renalware/research/study_participant.rb