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

This commit is contained in:
Daniel Waterworth 2019-10-28 17:56:47 +00:00
parent 79c2138955
commit 918bb76f76

View File

@ -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