diff --git a/app/controllers/api/v1/timelines/explore_controller.rb b/app/controllers/api/v1/timelines/explore_controller.rb index eb5665f4..af63c298 100644 --- a/app/controllers/api/v1/timelines/explore_controller.rb +++ b/app/controllers/api/v1/timelines/explore_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class Api::V1::Timelines::ExploreController < EmptyController +class Api::V1::Timelines::ExploreController < Api::BaseController before_action :set_sort_type before_action :set_statuses diff --git a/app/lib/sorting_query_builder.rb b/app/lib/sorting_query_builder.rb index 46e8505f..ed5b5a7d 100644 --- a/app/lib/sorting_query_builder.rb +++ b/app/lib/sorting_query_builder.rb @@ -51,9 +51,9 @@ class SortingQueryBuilder < BaseService query = StatusStat.where('status_stats.created_at > ?', date_limit) query = query.order(top_order) unless sort_type == 'recent' query = query.order(updated_at: :desc) if sort_type == 'recent' - query = query.where('status.stats.replies_count > ?', min_replies) unless sort_type == 'recent' - query = query.where('status.stats.reblogs_count > ?', min_reblogs) unless sort_type == 'recent' - query = query.where('status.stats.favourites_count > ?', min_likes) unless sort_type == 'recent' + query = query.where('status_stats.replies_count > ?', min_replies) unless sort_type == 'recent' + query = query.where('status_stats.reblogs_count > ?', min_reblogs) unless sort_type == 'recent' + query = query.where('status_stats.favourites_count > ?', min_likes) unless sort_type == 'recent' query = query.joins(:status) query = query.where('statuses.reblog_of_id IS NULL') query = query.where('statuses.in_reply_to_id IS NULL')