Sha256: 6df4cc0c35f28d62905a93531df26b02c6de64b51ae4d1a6da7b02a9d38876f5

Contents?: true

Size: 592 Bytes

Versions: 9

Compression:

Stored size: 592 Bytes

Contents

require_dependency "renalware/patients"

module Renalware
  module Patients
    class Bookmark < ApplicationRecord
      acts_as_paranoid

      belongs_to :user, class_name: "Renalware::Patients::User", foreign_key: :user_id
      # No touch required on patient
      belongs_to :patient, class_name: "Renalware::Patient", foreign_key: :patient_id

      validates :patient, presence: true
      validates :user, presence: true
      validates :user_id, uniqueness: { scope: [:patient_id, :deleted_at] }

      scope :ordered, -> { order(urgent: :desc, updated_at: :asc) }
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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