update menu category

This commit is contained in:
Aung Myo
2018-02-19 09:12:51 +06:30
parent 4743ab6558
commit 0504a9505b
7 changed files with 168 additions and 36 deletions

View File

@@ -4,7 +4,7 @@ class Menu < ApplicationRecord
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
#Default Scope to pull the active version only
default_scope { where(is_active: true).order("created_at desc") }
default_scope { where(is_active: true).order("created_at asc") }
def self.current_menu
today = DateTime.now