Skip to content

A platform for community discussion. Free, open, simple.

DEV: No need to look up a category repeatedly by its slug

Daniel Waterworth918bb76f7635
diff --git a/app/controllers/list_controller.rb b/app/controllers/list_controller.rb
index e7c0de86dc1..66833a623fc 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