app/support/reservations/validations.rb
# checks that the reservation is within the longest window for the groups the user is in
checks that the reservation is within the longest window for the groups the user is in
checks that the reservation is within the longest window for the groups the user is in
def in_window?
    groups   = order_detail.price_groups
    max_days = longest_reservation_window(groups)
    diff     = reserve_start_at.to_date - Date.today
    diff <= max_days
  end
def in_window? groups = order_detail . price_groups max_days = longest_reservation_window ( groups ) diff = reserve_start_at . to_date - Date . today diff <= max_days end
checks that the reservation is within the longest window for the groups the user is in
checks that the reservation is within the longest window for the groups the user is in