Sha256: 549a51773a0b3c0f6bc3979d333bd9b9fa47647bdb94243038c9b7264246bf0e

Contents?: true

Size: 574 Bytes

Versions: 15

Compression:

Stored size: 574 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/patients"

module Renalware
  module Patients
    class Bookmark < ApplicationRecord
      acts_as_paranoid

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

      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

15 entries across 15 versions & 1 rubygems

Version Path
renalware-core-2.1.1 app/models/renalware/patients/bookmark.rb
renalware-core-2.1.0 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.167 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.166 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.165 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.164 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.163 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.162 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.161 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.160 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.159 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.158 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.157 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.156 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.155 app/models/renalware/patients/bookmark.rb