This commit is contained in:
PhyoTheingi
2017-06-01 14:00:08 +06:30
parent 03bf799708
commit a7d7260157
11 changed files with 15 additions and 13 deletions

View File

@@ -2,7 +2,7 @@ class Menu < ApplicationRecord
has_many :menu_categories, dependent: :destroy
validates_presence_of :name, :valid_days, :valid_time_from, :valid_time_to
validates_format_of :valid_days, :with => /\A([0-7]{1}(,[0-7]{1})*)?\Z/i, :on => :create
validates_format_of :valid_days, :with => /\A([0-7]{1}(,[0-7]{1})*)?\Z/i
#Default Scope to pull the active version only
default_scope { where(is_active: true).order("created_at desc") }