FIX: ORDER BY for new topics within current category was second in list, needs to be first

This commit is contained in:
Neil Lalonde 2014-03-14 18:13:22 -04:00
parent 98284d771f
commit 20ced1a55e
1 changed files with 6 additions and 6 deletions

View File

@ -285,12 +285,6 @@ class TopicQuery
result
end
def new_results(options={})
result = TopicQuery.new_filter(default_results(options), @user.treat_as_new_topic_start_date)
result = remove_muted_categories(result, @user) unless options[:category].present?
suggested_ordering(result, options)
end
def latest_results(options={})
result = default_results(options)
result = remove_muted_categories(result, @user) unless options[:category].present?
@ -318,6 +312,12 @@ class TopicQuery
suggested_ordering(result, options)
end
def new_results(options={})
result = TopicQuery.new_filter(default_results(options.reverse_merge(:unordered => true)), @user.treat_as_new_topic_start_date)
result = remove_muted_categories(result, @user) unless options[:category].present?
suggested_ordering(result, options)
end
def random_suggested(topic, count, excluded_topic_ids=[])
result = default_results(unordered: true, per_page: count).where(closed: false, archived: false)
excluded_topic_ids += Category.pluck(:topic_id).compact