update feedback testing
This commit is contained in:
@@ -13,7 +13,7 @@ class MenuItem < ApplicationRecord
|
||||
has_many :menu_item_sets
|
||||
has_many :item_sets, through: :menu_item_sets
|
||||
|
||||
validates_presence_of :name, :type, :min_qty, :taxable
|
||||
validates_presence_of :name, :type, :min_qty, :taxable,:account_id
|
||||
|
||||
default_scope { order('item_code asc') }
|
||||
|
||||
@@ -53,13 +53,12 @@ class MenuItem < ApplicationRecord
|
||||
end
|
||||
|
||||
def self.deleteRecursive(menu_item)
|
||||
|
||||
# find the sub menu item of current item
|
||||
sub_menu_items = MenuItem.where("menu_item_id=?",menu_item.id)
|
||||
sub_menu_items = MenuItem.where("id=?",menu_item.id)
|
||||
if sub_menu_items.length != 0
|
||||
sub_menu_items.each do |subitem|
|
||||
if deleteRecursive(subitem)
|
||||
end
|
||||
# if deleteRecursive(subitem)
|
||||
# end
|
||||
end
|
||||
# find the instances of current menu item
|
||||
instances = MenuItemInstance.where("menu_item_id=?",menu_item.id)
|
||||
|
||||
Reference in New Issue
Block a user