menu is_active chcked

This commit is contained in:
phyusin
2018-11-16 14:51:40 +06:30
parent 26d44c0a7d
commit 574b3468be
4 changed files with 5 additions and 4 deletions

View File

@@ -6,7 +6,8 @@ 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 asc") }
default_scope { order("created_at asc") }
scope :active, -> {where("is_active = true")}
def self.current_menu
today = DateTime.now