mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +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
|
||||
|
||||
def reservation_deadline_minutes
|
||||
return Setting.get('event_reservation_deadline').to_i
|
||||
Setting.get('event_reservation_deadline').to_i
|
||||
end
|
||||
end
|
||||
|
@ -51,6 +51,6 @@ class CartItem::MachineReservation < CartItem::Reservation
|
||||
end
|
||||
|
||||
def reservation_deadline_minutes
|
||||
return Setting.get('machine_reservation_deadline').to_i
|
||||
Setting.get('machine_reservation_deadline').to_i
|
||||
end
|
||||
end
|
||||
|
@ -244,11 +244,10 @@ class CartItem::Reservation < CartItem::BaseItem
|
||||
operator.admin?
|
||||
end
|
||||
|
||||
##
|
||||
# Gets the deadline in minutes for slots in this reservation
|
||||
##
|
||||
# @return [Integer]
|
||||
def reservation_deadline_minutes
|
||||
return 0
|
||||
0
|
||||
end
|
||||
|
||||
# @param reservation_slot [CartItem::ReservationSlot]
|
||||
@ -274,7 +273,7 @@ class CartItem::Reservation < CartItem::BaseItem
|
||||
end
|
||||
|
||||
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
|
||||
end
|
||||
|
||||
|
@ -36,6 +36,6 @@ class CartItem::SpaceReservation < CartItem::Reservation
|
||||
end
|
||||
|
||||
def reservation_deadline_minutes
|
||||
return Setting.get('space_reservation_deadline').to_i
|
||||
Setting.get('space_reservation_deadline').to_i
|
||||
end
|
||||
end
|
||||
|
@ -47,6 +47,6 @@ class CartItem::TrainingReservation < CartItem::Reservation
|
||||
end
|
||||
|
||||
def reservation_deadline_minutes
|
||||
return Setting.get('training_reservation_deadline').to_i
|
||||
Setting.get('training_reservation_deadline').to_i
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user