sync token lookup
This commit is contained in:
@@ -14,10 +14,11 @@ class Booking < ApplicationRecord
|
||||
def self.sync_booking_records(bookings)
|
||||
if !bookings.nil?
|
||||
bookings.each do |b|
|
||||
unless Booking.exists?(b['booking_id'])
|
||||
booking = Booking.new
|
||||
unless TableBooking.exists?(b['booking_id'])
|
||||
booking = TableBooking.new
|
||||
booking.booking_id = b['booking_id']
|
||||
booking.dining_facility_id = b['dining_facility_id']
|
||||
booking.type = b['type']
|
||||
booking.checkin_at = b['checkin_at']
|
||||
booking.checkin_by = b['checkin_by']
|
||||
booking.checkout_at = b['checkout_at']
|
||||
|
||||
@@ -26,6 +26,11 @@ class Lookup < ApplicationRecord
|
||||
return lookup.value
|
||||
end
|
||||
|
||||
def self.get_sync_token
|
||||
lookup = Lookup.find_by_lookup_type('sync_token')
|
||||
return lookup.value
|
||||
end
|
||||
|
||||
def self.collection_of(type)
|
||||
Lookup.select("name, value").where("lookup_type" => type ).map { |l| [l.name, l.value] }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user