mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-21 15:54:22 +01:00
(bug) undefined local variable or method 'reservation_deadline'
(quality) linted code
This commit is contained in:
parent
c4fa240091
commit
779dd070b7
@ -73,6 +73,6 @@ class CartItem::EventReservation < CartItem::Reservation
|
|||||||
end
|
end
|
||||||
|
|
||||||
def reservation_deadline_minutes
|
def reservation_deadline_minutes
|
||||||
return Setting.get('event_reservation_deadline').to_i
|
Setting.get('event_reservation_deadline').to_i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -51,6 +51,6 @@ class CartItem::MachineReservation < CartItem::Reservation
|
|||||||
end
|
end
|
||||||
|
|
||||||
def reservation_deadline_minutes
|
def reservation_deadline_minutes
|
||||||
return Setting.get('machine_reservation_deadline').to_i
|
Setting.get('machine_reservation_deadline').to_i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -244,11 +244,10 @@ class CartItem::Reservation < CartItem::BaseItem
|
|||||||
operator.admin?
|
operator.admin?
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
|
||||||
# Gets the deadline in minutes for slots in this reservation
|
# Gets the deadline in minutes for slots in this reservation
|
||||||
##
|
# @return [Integer]
|
||||||
def reservation_deadline_minutes
|
def reservation_deadline_minutes
|
||||||
return 0
|
0
|
||||||
end
|
end
|
||||||
|
|
||||||
# @param reservation_slot [CartItem::ReservationSlot]
|
# @param reservation_slot [CartItem::ReservationSlot]
|
||||||
@ -274,7 +273,7 @@ class CartItem::Reservation < CartItem::BaseItem
|
|||||||
end
|
end
|
||||||
|
|
||||||
if slot.start_at < reservation_deadline_minutes.minutes.since && !operator.privileged?
|
if slot.start_at < reservation_deadline_minutes.minutes.since && !operator.privileged?
|
||||||
errors.add(:slot, I18n.t('cart_item_validation.deadline', { MINUTES: reservation_deadline }))
|
errors.add(:slot, I18n.t('cart_item_validation.deadline', { MINUTES: reservation_deadline_minutes }))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -36,6 +36,6 @@ class CartItem::SpaceReservation < CartItem::Reservation
|
|||||||
end
|
end
|
||||||
|
|
||||||
def reservation_deadline_minutes
|
def reservation_deadline_minutes
|
||||||
return Setting.get('space_reservation_deadline').to_i
|
Setting.get('space_reservation_deadline').to_i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -47,6 +47,6 @@ class CartItem::TrainingReservation < CartItem::Reservation
|
|||||||
end
|
end
|
||||||
|
|
||||||
def reservation_deadline_minutes
|
def reservation_deadline_minutes
|
||||||
return Setting.get('training_reservation_deadline').to_i
|
Setting.get('training_reservation_deadline').to_i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user