Sha256: 4e226c054b07726b483d3794683c8dfca2c0dc3310ca1f71781eeb302dab0606

Contents?: true

Size: 553 Bytes

Versions: 9

Compression:

Stored size: 553 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
      belongs_to :patient, class_name: "Renalware::Patient", foreign_key: :patient_id

      validates :patient, presence: true
      validates :user, presence: true
      validates_uniqueness_of :user_id, 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.0.pre.beta12 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.0.pre.beta11 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.0.pre.beta10 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.0.pre.beta9 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.0.pre.beta8 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.0.pre.beta7 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.0.pre.beta6 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.0.pre.beta5 app/models/renalware/patients/bookmark.rb
renalware-core-2.0.0.pre.beta4 app/models/renalware/patients/bookmark.rb