Sha256: 9ba3cfeb8efe5329846f3ea7321cba15dc51beedbd6bd07d5c34cf01c897517c
Contents?: true
Size: 821 Bytes
Versions: 17
Compression:
Stored size: 821 Bytes
Contents
# frozen_string_literal: true 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 validates :external_id, uniqueness: true # added by a trigger 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 def external_application_participant_url return if study.application_url.blank? study.application_url.gsub("{external_id}", external_id.to_s) end end end end
Version data entries
17 entries across 17 versions & 1 rubygems