app/support/reservations/validations.rb
#
# Look for a reservation on the same instrument that conflicts in time with a
# purchased, admin, or in-cart reservation. Should not check reservations that
# are unpurchased in other user's carts.
Look for a reservation on the same instrument that conflicts in time with a
purchased, admin, or in-cart reservation. Should not check reservations that
are unpurchased in other user's carts.
Look for a reservation on the same instrument that conflicts in time with a purchased admin or in - cart reservation . Should not check reservations that are unpurchased in other user ' s carts .
def conflicting_user_reservation(options = {})
    order_id = order_detail.try(:order_id) || 0
    conflicting_reservations =
      Reservation
      .joins_order
      .where(product_id: product.schedule.product_ids)
      .user
      .not_this_reservation(options[:exclude] || self)
      .not_canceled
      .not_ended
      .where("(orders.state = 'purchased' OR orders.state IS NULL OR orders.id = ?)", order_id)
      .overlapping(reserve_start_at, reserve_end_at)
    conflicting_reservations.first
  end
def conflicting_user_reservation ( options = { } ) order_id = order_detail . try ( :order_id ) || 0 conflicting_reservations = Reservation . joins_order . where ( product_id : product . schedule . product_ids ) . user . not_this_reservation ( options [ :exclude ] || self ) . not_canceled . not_ended . where ( "(orders.state = 'purchased' OR orders.state IS NULL OR orders.id = ?)" , order_id ) . overlapping ( reserve_start_at , reserve_end_at ) conflicting_reservations . first end
Look for a reservation on the same instrument that conflicts in time with a
purchased, admin, or in-cart reservation.
Look for a reservation on the same instrument that conflicts in time with a purchased admin or in - cart reservation .
options
<not_specific>