update model for menu
This commit is contained in:
@@ -1,2 +1,7 @@
|
||||
class ItemSet < ApplicationRecord
|
||||
has_many :menu_item_sets
|
||||
has_many :menu_items, through: :menu_item_sets
|
||||
|
||||
has_many :menu_instance_item_sets
|
||||
has_many :menu_item_instances, through: :menu_item_sets
|
||||
end
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
class MenuInstanceItemSet < ApplicationRecord
|
||||
belongs_to :item_set
|
||||
belongs_to :menu_item_instance
|
||||
end
|
||||
|
||||
@@ -8,6 +8,9 @@ class MenuItem < ApplicationRecord
|
||||
has_many :children, :class_name => "MenuItem", foreign_key: "menu_item_id"
|
||||
belongs_to :account
|
||||
|
||||
has_many :menu_item_sets
|
||||
has_many :item_sets, through: :menu_item_sets
|
||||
|
||||
validates_presence_of :name, :type, :min_qty, :taxable, :min_selectable_item, :max_selectable_item
|
||||
|
||||
default_scope { order('item_code asc') }
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
class MenuItemSet < ApplicationRecord
|
||||
belongs_to :item_set
|
||||
belongs_to :menu_item
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user