Menu item with Accout

This commit is contained in:
PhyoTheingi
2017-06-06 17:29:34 +06:30
parent 2abc2e5f3d
commit 59434e2c3a
11 changed files with 25 additions and 11 deletions

View File

@@ -1,9 +1,10 @@
class MenuItem < ApplicationRecord
# belongs_to :account
belongs_to :menu_category, :optional => true
has_many :menu_item_instances
belongs_to :parent, :class_name => "MenuItem", foreign_key: "menu_item_id", :optional => true
has_many :children, :class_name => "MenuItem", foreign_key: "menu_item_id"
belongs_to :account
validates_presence_of :item_code, :name, :type, :min_qty, :taxable, :min_selectable_item, :max_selectable_item