From 918bb76f7635362ca9cae76834f79f0a570707f2 Mon Sep 17 00:00:00 2001 From: Daniel Waterworth Date: Mon, 28 Oct 2019 17:56:47 +0000 Subject: [PATCH] DEV: No need to look up a category repeatedly by its slug --- app/controllers/list_controller.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/list_controller.rb b/app/controllers/list_controller.rb index e7c0de86dc..66833a623f 100644 --- a/app/controllers/list_controller.rb +++ b/app/controllers/list_controller.rb @@ -140,11 +140,7 @@ class ListController < ApplicationController view_method = @category.default_view view_method = 'latest' unless %w(latest top).include?(view_method) - if view_method == 'top' - top(category: @category.id) - else - self.public_send(view_method) - end + self.public_send(view_method, category: @category.id) end def topics_by