diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2020-09-07 11:02:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-07 11:02:04 +0200 |
commit | e8bc187845b78e4a94894c69ecf930a524ad2056 (patch) | |
tree | 5d406773ebc580f361996222bd636bdaac108b2b /app/services/hashtag_query_service.rb | |
parent | a6121a159c5305ea9faa95743a50babb23ab41cd (diff) |
Refactor how public and tag timelines are queried (#14728)
Diffstat (limited to 'app/services/hashtag_query_service.rb')
-rw-r--r-- | app/services/hashtag_query_service.rb | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/app/services/hashtag_query_service.rb b/app/services/hashtag_query_service.rb deleted file mode 100644 index 0bdf60221..000000000 --- a/app/services/hashtag_query_service.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class HashtagQueryService < BaseService - LIMIT_PER_MODE = 4 - - def call(tag, params, account = nil, local = false) - tags = tags_for(Array(tag.name) | Array(params[:any])).pluck(:id) - all = tags_for(params[:all]) - none = tags_for(params[:none]) - - Status.group(:id) - .as_tag_timeline(tags, account, local) - .tagged_with_all(all) - .tagged_with_none(none) - end - - private - - def tags_for(names) - Tag.matching_name(Array(names).take(LIMIT_PER_MODE)) if names.present? - end -end |