re-add validate for menu item and cat

This commit is contained in:
Yan
2017-07-12 10:20:43 +06:30
parent 7bbc803c95
commit 465055aacb
2 changed files with 2 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ class MenuCategory < ApplicationRecord
belongs_to :parent, :class_name => "MenuCategory", foreign_key: "menu_category_id", optional: true
has_many :menu_items
validates_presence_of :name, :menu, :order_by
validates_presence_of :name, :menu, :code, :order_by
default_scope { order('order_by asc') }

View File

@@ -8,7 +8,7 @@ class MenuItem < ApplicationRecord
has_many :children, :class_name => "MenuItem", foreign_key: "menu_item_id"
belongs_to :account
validates_presence_of :name, :type, :min_qty, :taxable, :min_selectable_item, :max_selectable_item
validates_presence_of :item_code, :name, :type, :min_qty, :taxable, :min_selectable_item, :max_selectable_item
default_scope { order('item_code asc') }