0
0
Fork 0

Use composable query in User.active scope (#29775)

This commit is contained in:
Matt Jankowski 2024-04-08 09:53:49 -04:00 committed by GitHub
parent babbf6017d
commit 285f63c02e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 45 additions and 11 deletions

View file

@ -18,7 +18,7 @@ class FeedManager
# @yield [Account]
# @return [void]
def with_active_accounts(&block)
Account.joins(:user).where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago).find_each(&block)
Account.joins(:user).merge(User.signed_in_recently).find_each(&block)
end
# Redis key of a feed