summaryrefslogtreecommitdiff
path: root/rvh/app/models/bed.rb
blob: 0b0869ebfaebf771eaa2ca09460919ace4ad69ac (plain)
1
2
3
4
5
6
7
8
9
10
class Bed < ApplicationRecord
  belongs_to :care_centre
  belongs_to :patient, optional: true

  scope :available, -> { where(patient: nil) }

  def available?
    patient.blank?
  end
end