From 0e20dc87ba746ca514bf5295eb939ef3d8d258a8 Mon Sep 17 00:00:00 2001 From: dim145 Date: Wed, 27 Mar 2024 18:42:07 +0100 Subject: [PATCH] fix: default avaibilities not use season filter --- app/controllers/planning_controller.rb | 2 +- lib/elvis/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/planning_controller.rb b/app/controllers/planning_controller.rb index 695fc52b..d8647211 100755 --- a/app/controllers/planning_controller.rb +++ b/app/controllers/planning_controller.rb @@ -564,7 +564,7 @@ def add_default_to_planning render json: "already filled or planning locked", status: :bad_request and return if planning.is_locked || exist_intervals.count > 0 # @type [Array] - default_intervals = School.first&.planning&.time_intervals&.to_a || [] + default_intervals = School.first&.planning&.time_intervals&.where(start: season.start..season.end)&.to_a || [] return render json: {message: "pas de planning par défaut de saisie par l'école"}, status: :ok if default_intervals.nil? diff --git a/lib/elvis/version.rb b/lib/elvis/version.rb index ca7cccf4..47374479 100644 --- a/lib/elvis/version.rb +++ b/lib/elvis/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Elvis - VERSION = "2.2.7" + VERSION = "2.2.8" end