class Covid::EmployeeTemperature < ApplicationRecord
  belongs_to :employee

  validates :recorded_at, :recorded_by, :temperature, presence: true

  scope :by_date_range, ->(range) { where(recorded_at: range) if range.present? }
  scope :by_date, ->(date) { where(recorded_at: date.to_date.all_day) if date }
end
