This repository has been archived on 2024-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-24 11:01:43 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class AccountSuggestions::GlobalSource < AccountSuggestions::Source
|
2023-12-19 05:59:43 -05:00
|
|
|
def get(account, limit: 10)
|
|
|
|
FollowRecommendation.localized(content_locale).joins(:account).merge(base_account_scope(account)).order(rank: :desc).limit(limit).pluck(:account_id, :reason)
|
2021-04-24 11:01:43 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
2023-12-19 05:59:43 -05:00
|
|
|
def content_locale
|
|
|
|
I18n.locale.to_s.split(/[_-]/).first
|
2021-04-24 11:01:43 -04:00
|
|
|
end
|
|
|
|
end
|