From 668ae018c1f2b3c09fa202da4aff2e251c38d07b Mon Sep 17 00:00:00 2001 From: ajugo Date: Mon, 18 Dec 2023 16:28:41 +0100 Subject: [PATCH] Fix activity to_date filtering [SCI-9704] (#6840) --- app/services/activities_service.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/services/activities_service.rb b/app/services/activities_service.rb index 24e82d9c4..12e6927a3 100644 --- a/app/services/activities_service.rb +++ b/app/services/activities_service.rb @@ -37,6 +37,8 @@ class ActivitiesService to: Time.zone.parse(filters[:to_date]).beginning_of_day.utc) elsif filters[:from_date].present? && filters[:to_date].blank? query.where('created_at <= :from', from: Time.zone.parse(filters[:from_date]).end_of_day.utc) + elsif filters[:from_date].blank? && filters[:to_date].present? + query.where('created_at >= :to', to: Time.zone.parse(filters[:to_date]).beginning_of_day.utc) else query end