From 8669cc82dacc2ae221b71e1c7c8a580cde3d68fa Mon Sep 17 00:00:00 2001 From: Sylvain Date: Thu, 16 Feb 2023 16:53:52 +0100 Subject: [PATCH] (bug) admin should see locked availabilities --- app/services/availabilities/availabilities_service.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/services/availabilities/availabilities_service.rb b/app/services/availabilities/availabilities_service.rb index e173080b2..9ab7388e6 100644 --- a/app/services/availabilities/availabilities_service.rb +++ b/app/services/availabilities/availabilities_service.rb @@ -17,7 +17,7 @@ class Availabilities::AvailabilitiesService # @param window [Hash] the time window the look through: {start: xxx, end: xxx} # @option window [ActiveSupport::TimeWithZone] :start # @option window [ActiveSupport::TimeWithZone] :end - # @param ids [Array] + # @param ids [Hash{Symbol->ActionController::Parameters | Array}] # @param events [Boolean] should events be included in the results? def index(window, ids, events: false) machines_availabilities = Setting.get('machines_module') ? machines(Machine.where(id: ids[:machines]), @current_user, window) : [] @@ -133,7 +133,6 @@ class Availabilities::AvailabilitiesService .joins(:slots) .where('availabilities.start_at <= ? AND availabilities.end_at >= ? AND available_type = ?', range_end, window_start, type) .where('slots.start_at > ? AND slots.end_at < ?', window_start, range_end) - .where(lock: false) # 2) an user (he cannot see past availabilities neither those further than 1 (or 3) months in the future) else end_at = @maximum_visibility[:other]