update for order process

Add activereocrd-import gem for bulk insert
This commit is contained in:
Thein Lin Kyaw
2019-12-09 10:33:10 +06:30
parent 67e7658e56
commit 3a99e1bb09
22 changed files with 441 additions and 959 deletions

View File

@@ -9,8 +9,11 @@ class Booking < ApplicationRecord
has_many :booking_orders
has_many :orders, :through => :booking_orders
has_many :order_items, :through => :orders
scope :active, -> {where("booking_status != 'moved'")}
scope :today, -> {where("created_at >= #{Time.now.utc}")}
scope :assign, -> { where(booking_status: 'assign')}
scope :within_time_limit, -> { where(checkin_at: Lookup.get_checkin_time_limit.hours.ago..DateTime::Infinity.new) }
def self.sync_booking_records(bookings)
if !bookings.nil?