Use composable query in User.active
scope (#29775)
This commit is contained in:
parent
babbf6017d
commit
285f63c02e
5 changed files with 45 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue