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
|
@ -255,13 +255,13 @@ module Account::Interactions
|
|||
def followers_for_local_distribution
|
||||
followers.local
|
||||
.joins(:user)
|
||||
.where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago)
|
||||
.merge(User.signed_in_recently)
|
||||
end
|
||||
|
||||
def lists_for_local_distribution
|
||||
scope = lists.joins(account: :user)
|
||||
scope.where.not(list_accounts: { follow_id: nil }).or(scope.where(account_id: id))
|
||||
.where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago)
|
||||
.merge(User.signed_in_recently)
|
||||
end
|
||||
|
||||
def remote_followers_hash(url)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue