before sync

This commit is contained in:
Zoey
2019-06-21 10:04:35 +06:30
parent 60a3655dc3
commit f21d144111
17 changed files with 229 additions and 161 deletions

View File

@@ -21,14 +21,37 @@ class Lookup < ApplicationRecord
# Lookup.select("value, name").where("lookup_type = ?", lookup_type ).order("name asc").map { |r| [r.name, r.value] }
# 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
end
def self.sync_url
url = ""
lookup = Lookup.find_by_lookup_type('sync_data')
return lookup.value
if !lookup.nil?
url = lookup.value
end
return url
end
def self.get_sync_token
token = ""
lookup = Lookup.find_by_lookup_type('sync_token')
return lookup.value
if !lookup.nil?
token = lookup.value
end
return token
end
def self.collection_of(type)