Sha256: e425f7d96f1fb71d91b884ed2047f96fa43d1d61f6a27926b89e533d0069b6d6

Contents?: true

Size: 520 Bytes

Versions: 1

Compression:

Stored size: 520 Bytes

Contents

module Ecom
  module Core
    class BookedEquipment < ApplicationRecord
      BOOKED = 'Booked'.freeze
      ON_SITE = 'On Site'.freeze
      RETURNED = 'Returned'.freeze

      STATUSES = [BOOKED, ON_SITE, RETURNED].freeze

      belongs_to :booking_request
      belongs_to :equipment_item
      belongs_to :booked_to, class_name: 'Ecom::Core::User'

      validates :start_date, :end_date, :status, presence: true
      validates :status, inclusion: STATUSES
      validates_with DateRangeValidator
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ecom_core-1.2.12 app/models/ecom/core/booked_equipment.rb