optimize for dashboards
This commit is contained in:
@@ -11,11 +11,11 @@ class MenuItem < ApplicationRecord
|
||||
belongs_to :account
|
||||
|
||||
has_many :menu_item_sets
|
||||
has_many :item_sets, through: :menu_item_sets
|
||||
has_and_belongs_to_many :item_sets, join_table: "menu_item_sets"
|
||||
|
||||
validates_presence_of :item_code, :name, :type, :min_qty,:account_id
|
||||
validates_uniqueness_of :item_code
|
||||
|
||||
|
||||
default_scope { order('item_code asc') }
|
||||
|
||||
scope :simple_menu_item, -> { where(type: 'SimpleMenuItem') }
|
||||
|
||||
Reference in New Issue
Block a user