From 8a6623e463040cfa18092f547cc3a8df38b1e508 Mon Sep 17 00:00:00 2001 From: 2458773093 <2458773093@protonmail.com> Date: Tue, 20 Aug 2019 03:10:22 +0300 Subject: [PATCH] fix group local account list for distributions so it does not include users who disabled group posts in feed --- app/models/concerns/group_interactions.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/concerns/group_interactions.rb b/app/models/concerns/group_interactions.rb index 7f3ef298..e15e1836 100644 --- a/app/models/concerns/group_interactions.rb +++ b/app/models/concerns/group_interactions.rb @@ -32,6 +32,8 @@ module GroupInteractions accounts.local .joins(:user) .where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago) + .where('users.id NOT IN (SELECT thing_id FROM settings WHERE thing_type = \'User\' AND var = \'group_in_home_feed\' AND value = \'--- false +\')') end end