From 1a748906447a5e6dc7c006e24b67ec9bbc7f8d27 Mon Sep 17 00:00:00 2001 From: dim145 Date: Tue, 2 Apr 2024 10:16:32 +0200 Subject: [PATCH] fix: no method error && bump --- app/controllers/parameters/planning_parameters_controller.rb | 4 ++-- lib/elvis/version.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/parameters/planning_parameters_controller.rb b/app/controllers/parameters/planning_parameters_controller.rb index 0ea4a87a..2de64deb 100644 --- a/app/controllers/parameters/planning_parameters_controller.rb +++ b/app/controllers/parameters/planning_parameters_controller.rb @@ -21,9 +21,9 @@ def index end current_season = Season.current + previous_season = current_season.previous - if @school.planning.time_intervals.where(start: current_season.start..current_season.end).empty? - previous_season = Season.previous + if previous_season.present? && @school.planning.time_intervals.where(start: current_season.start..current_season.end).empty? school_availabilities = @school.planning.time_intervals.where(start: previous_season.start..previous_season.end).to_a school_availabilities = school_availabilities.map do |availability| diff --git a/lib/elvis/version.rb b/lib/elvis/version.rb index 5d310842..8f22e13e 100644 --- a/lib/elvis/version.rb +++ b/lib/elvis/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Elvis - VERSION = "2.2.10" + VERSION = "2.2.11" end