update for order process
Add activereocrd-import gem for bulk insert
This commit is contained in:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user