mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-30 19:52:20 +01:00
fix bug: validator of reservation can't find if slot has reserved by reservable type
This commit is contained in:
parent
099359e42d
commit
a0d158974b
@ -2,6 +2,8 @@
|
||||
|
||||
## next deploy
|
||||
|
||||
- Fix a bug: validator of reservation can't find if slot has reserved by reservable type
|
||||
|
||||
## v5.4.8 2022 June 29
|
||||
|
||||
- My reservations dashboard
|
||||
|
@ -50,8 +50,8 @@ class CartItem::Reservation < CartItem::BaseItem
|
||||
end
|
||||
|
||||
if availability.available_type == 'machines'
|
||||
s = Slot.find_by(start_at: slot[:start_at], end_at: slot[:end_at], availability_id: slot[:availability_id], canceled_at: nil)
|
||||
unless s.nil?
|
||||
s = Slot.includes(:reservations).where(start_at: slot[:start_at], end_at: slot[:end_at], availability_id: slot[:availability_id], canceled_at: nil, "reservations.reservable": @reservable)
|
||||
unless s.empty?
|
||||
@errors[:slot] = 'slot is reserved'
|
||||
return false
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user