added menu osaka

This commit is contained in:
Nweni
2017-07-11 10:18:08 +06:30
parent 15cbac995f
commit a06f5515fc
6 changed files with 494 additions and 10 deletions

View File

@@ -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