From c6e4d6ef94ab8176ba70027a002df5f3953359e0 Mon Sep 17 00:00:00 2001 From: aignatov-bio Date: Wed, 10 Mar 2021 12:58:05 +0100 Subject: [PATCH] Fix activities multiple types selected [SCI-5546] --- app/services/activities_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/activities_service.rb b/app/services/activities_service.rb index 8ed400751..509c5c60c 100644 --- a/app/services/activities_service.rb +++ b/app/services/activities_service.rb @@ -28,7 +28,8 @@ class ActivitiesService end query = query.where(owner_id: filters[:users]) if filters[:users] - query = query.where(type_of: filters[:types]) if filters[:types] + query = query.where(type_of: filters[:types].map(&:to_i)) if filters[:types] + query = query.where('created_at <= ?', Time.at(filters[:starting_timestamp].to_i)) if filters[:starting_timestamp] activities =