app/support/reservations/validations.rb
# return the longest available reservation window for the groups
return the longest available reservation window for the groups
return the longest available reservation window for the groups
def longest_reservation_window(groups = [])
    return default_reservation_window if groups.empty?
    product
      .price_group_products
      .where(price_group_id: groups.map(&:id))
      .pluck(:reservation_window)
      .max
  end
def longest_reservation_window ( groups = [ ] ) return default_reservation_window if groups . empty? product . price_group_products . where ( price_group_id : groups . map ( & :id ) ) . pluck ( :reservation_window ) . max end
return the longest available reservation window for the groups
return the longest available reservation window for the groups
groups
<not_specific>