1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00
mastodon/app/models/account_suggestions/global_source.rb

14 lines
381 B
Ruby
Raw Normal View History

# 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