update origami/home/index
This commit is contained in:
@@ -4,6 +4,8 @@ class Lookup < ApplicationRecord
|
||||
|
||||
scope :number_formats, -> { where(lookup_type: 'number_format')}
|
||||
|
||||
TIME_LIMIT = 5
|
||||
|
||||
def available_types
|
||||
{'Employee Roles' => 'employee_roles',
|
||||
'Dining Facilities Status' => 'dining_facilities_status',
|
||||
@@ -23,15 +25,13 @@ class Lookup < ApplicationRecord
|
||||
# Lookup.select("value, name").where("lookup_type = ?", lookup_type ).order("name asc").map { |r| [r.name, r.value] }
|
||||
# end
|
||||
|
||||
def self.time_limit
|
||||
TIME_LIMIT
|
||||
end
|
||||
|
||||
def self.get_checkin_time_limit
|
||||
time_limit = 5
|
||||
|
||||
lookup = Lookup.find_by_lookup_type('checkin_time_limit')
|
||||
if !lookup.nil?
|
||||
time_limit = lookup.value.to_i
|
||||
end
|
||||
|
||||
return time_limit
|
||||
return RequestStore[:checkin_time_limit] if RequestStore[:checkin_time_limit]
|
||||
RequestStore[:checkin_time_limit] = Lookup.find_by_lookup_type('checkin_time_limit').value.to_i rescue time_limit
|
||||
end
|
||||
|
||||
def self.sync_url
|
||||
@@ -58,7 +58,6 @@ class Lookup < ApplicationRecord
|
||||
|
||||
def self.collection_of(type)
|
||||
Lookup.select("name, value").where("lookup_type" => type ).map { |l| [l.name, l.value] }
|
||||
|
||||
end
|
||||
|
||||
def self.create_shift_sale_lookup
|
||||
|
||||
Reference in New Issue
Block a user