Class: InventoryReservation

Inherits:
ApplicationRecord show all
Defined in:
app/models/inventory_reservation.rb

Overview

Schema Information

Table name: inventory_reservations

id                  :bigint           unsigned, not null, primary key
booked_seat         :integer          default(0)
inventory_type      :string(191)      default("\"Inventory\"")
created_at          :datetime         not null
updated_at          :datetime         not null
inventory_id        :bigint           unsigned, not null
inventory_source_id :bigint
reservation_id      :integer          not null
restaurant_id       :integer          not null

Indexes

index_inventory_reservations_on_inventory_id                    (inventory_id)
index_inventory_reservations_on_inventory_id_and_restaurant_id  (inventory_id,restaurant_id)
index_inventory_reservations_on_inventory_id_and_type           (inventory_id,inventory_type)
index_inventory_reservations_on_inventory_source_id             (inventory_source_id)
index_inventory_reservations_on_reservation_id                  (reservation_id)
uniq_inv_reservation_inv_type                                   (inventory_id,reservation_id,inventory_type) UNIQUE

Foreign Keys

fk_rails_...  (inventory_source_id => inventory_sources.id)
fk_rails_...  (reservation_id => reservations.id)

Class Method Summary collapse

Methods inherited from ApplicationRecord

sync_carrierwave_url

Class Method Details

.inventory_id_columnObject



34
35
36
# File 'app/models/inventory_reservation.rb', line 34

def self.inventory_id_column
  :inventory_id
end