Class: HhPackage::Package::MenuSection

Inherits:
ApplicationRecord show all
Includes:
IdentityCache
Defined in:
app/models/hh_package/package/menu_section.rb

Overview

typed: ignore

Schema Information

Table name: hh_package_package_menu_sections

id                                 :integer          not null, primary key
description                        :string(191)
is_require                         :boolean          default(FALSE)
name                               :text(65535)
package_type                       :string(191)
priority                           :integer          default(10), not null
quantity_limit                     :integer
seasonal                           :boolean          default(FALSE)
seasonal_end_date                  :date
seasonal_start_date                :date
created_at                         :datetime         not null
updated_at                         :datetime         not null
hh_package_package_menu_section_id :integer          not null
package_id                         :integer
package_menu_id                    :integer

Indexes

index_hh_package_package_menu_sections_on_package_menu_id  (package_menu_id)
menu_section_package_index                                 (package_type,package_id)

Foreign Keys

fk_rails_...  (package_menu_id => hh_package_package_menus.id)

Instance Method Summary collapse

Methods inherited from ApplicationRecord

sync_carrierwave_url

Instance Method Details

#quantity_limitObject



55
56
57
58
59
60
61
# File 'app/models/hh_package/package/menu_section.rb', line 55

def quantity_limit
  if package_menu_id.present?
    1
  else
    self[:quantity_limit]
  end
end