Class: ReservationAddOn

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

Overview

Schema Information

Table name: reservation_add_ons

id                   :bigint           not null, primary key
commission           :float(24)
price_cents          :integer          default(0), not null
price_currency       :string(191)      default("THB"), not null
quantity             :integer          default(1), not null
created_at           :datetime         not null
updated_at           :datetime         not null
reservation_id       :integer
restaurant_add_on_id :bigint

Indexes

index_reservation_add_ons_on_reservation_id        (reservation_id)
index_reservation_add_ons_on_restaurant_add_on_id  (restaurant_add_on_id)
restaurant_add_on_sold                             (restaurant_add_on_id,reservation_id) UNIQUE

Foreign Keys

fk_rails_...  (reservation_id => reservations.id)
fk_rails_...  (restaurant_add_on_id => restaurant_add_ons.id)

Method Summary

Methods inherited from ApplicationRecord

sync_carrierwave_url