Fix activity to_date filtering [SCI-9704] (#6840)

This commit is contained in:
ajugo 2023-12-18 16:28:41 +01:00 committed by GitHub
parent 8a9d4a772a
commit 668ae018c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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