You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
381 B

# frozen_string_literal: true
class AccountSuggestions::GlobalSource < AccountSuggestions::Source
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)
end
private
def content_locale
I18n.locale.to_s.split(/[_-]/).first
end
end