A platform for community discussion. Free, open, simple.
DEV: Remove unused code from `TopicView`. (#14605)
Alan Guo Xiang Tanc34c24ffe4bc
diff --git a/lib/topic_view.rb b/lib/topic_view.rbindex 1f4817e8655..bcd61346753 100644--- a/lib/topic_view.rb+++ b/lib/topic_view.rb@@ -87,7 +87,6 @@ class TopicViewcheck_and_raise_exceptions(options[:skip_staff_action])@message_bus_last_id = MessageBus.last_id("/topic/#{@topic.id}")- @print = options[:print].present?options.each do |key, value|self.instance_variable_set("@#{key}".to_sym, value)@@ -109,10 +108,6 @@ class TopicView@page = @page.to_i > 1 ? @page.to_i : calculate_pagesetup_filtered_posts-- @initial_load = true- @index_reverse = false-filter_posts(options)if @posts && !@skip_custom_fields@@ -317,13 +312,6 @@ class TopicView@group_names = resultend- # Find the sort order for a post in the topic- def sort_order_for_post_number(post_number)- posts = Post.where(topic_id: @topic.id, post_number: post_number).with_deleted- posts = filter_post_types(posts)- posts.select(:sort_order).first.try(:sort_order)- end-# Filter to all posts near a particular post numberdef filter_posts_near(post_number)posts_before = (@limit.to_f / 4).floor@@ -564,12 +552,6 @@ class TopicView@link_counts ||= TopicLink.counts_for(@guardian, @topic, posts)end- # Are we the initial page load? If so, we can return extra information like- # user post counts, etc.- def initial_load?- @initial_load- end-def pm_params@pm_params ||= TopicQuery.new(@user).get_pm_params(topic)end