Class: GoogleReservePackage

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

Overview

Schema Information

Table name: google_reserve_packages

id                                  :bigint           not null, primary key
ai_generated_package_description    :string(500)
custom_package_description          :string(500)
custom_package_name                 :string(191)
force_prepayment                    :boolean          default(TRUE)
package_type                        :string(191)      not null
created_at                          :datetime         not null
updated_at                          :datetime         not null
google_reserve_id                   :bigint           not null
package_id                          :bigint           not null
restaurant_id                       :bigint           not null
restaurant_package_id               :integer          not null

Indexes

index_google_reserve_packages_on_google_reserve_id            (google_reserve_id)
index_google_reserve_packages_on_package_id_and_package_type  (package_id,package_type)
index_google_reserve_packages_on_restaurant_id                (restaurant_id)
index_google_reserve_packages_on_restaurant_package_id        (restaurant_package_id)
index_unique_restaurant_package_id                            (restaurant_package_id) UNIQUE

Foreign Keys

fk_rails_...  (google_reserve_id => google_reserves.id)

Constant Summary collapse

PACKAGE_TYPES =
['HhPackage::Package::Ayce', 'HhPackage::Package::PartyPack'].freeze
DESCRIPTION_LIMIT =
500
MAX_WORD_BOUNDARY_CUTBACK =

Maximum characters to trim back from the end to find a word boundary If we need to cut more than this many characters to avoid splitting a word, just cut mid-word 20 chars ≈ 2-3 words, enough to avoid mid-word cuts without losing too much content

20

Method Summary

Methods inherited from ApplicationRecord

sync_carrierwave_url