added menu osaka
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
class MenuItemInstance < ApplicationRecord
|
||||
belongs_to :menu_item
|
||||
|
||||
before_create :generate_menu_item_instance_code
|
||||
|
||||
def self.findParentCategory(item)
|
||||
if item.menu_category_id
|
||||
return item.menu_category_id
|
||||
@@ -9,4 +10,10 @@ class MenuItemInstance < ApplicationRecord
|
||||
findParentCategory(parentitem)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def generate_menu_item_instance_code
|
||||
self.item_instance_code = SeedGenerator.generate_id(self.class.name, "II")
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user