Sha256: 2f92b211cce6dea9394334456e5bef41cca8550deb637ed7c83296444aa85036

Contents?: true

Size: 611 Bytes

Versions: 13

Compression:

Stored size: 611 Bytes

Contents

require_dependency "renalware/research"

module Renalware
  module Research
    class Study < ApplicationRecord
      include Accountable
      acts_as_paranoid

      validates :code, presence: true, uniqueness: { scope: :deleted_at }
      validates :description, presence: true
      validates :started_on, timeliness: { type: :date, allow_blank: true }
      validates :terminated_on, timeliness: { type: :date, allow_blank: true, after: :started_on }

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

      has_many :participants, class_name: "StudyParticipant", dependent: :destroy
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.rc11 app/models/renalware/research/study.rb
renalware-core-2.0.0.pre.rc10 app/models/renalware/research/study.rb
renalware-core-2.0.0.pre.rc9 app/models/renalware/research/study.rb
renalware-core-2.0.0.pre.rc8 app/models/renalware/research/study.rb
renalware-core-2.0.0.pre.rc7 app/models/renalware/research/study.rb
renalware-core-2.0.0.pre.rc6 app/models/renalware/research/study.rb
renalware-core-2.0.0.pre.rc5 app/models/renalware/research/study.rb
renalware-core-2.0.0.pre.rc4 app/models/renalware/research/study.rb
renalware-core-2.0.0.pre.rc3 app/models/renalware/research/study.rb
renalware-core-2.0.0.pre.rc1 app/models/renalware/research/study.rb
renalware-core-2.0.0.pre.beta12 app/models/renalware/research/study.rb
renalware-core-2.0.0.pre.beta11 app/models/renalware/research/study.rb
renalware-core-2.0.0.pre.beta10 app/models/renalware/research/study.rb