From ad1c7ae51dea93029b8f265c1a004a19b658d79b Mon Sep 17 00:00:00 2001 From: Jeffrey Hardy Date: Thu, 3 Oct 2024 14:10:11 -0400 Subject: [PATCH] Remove redundant ordering for most-active bubbles The base bubbles query is the same, differing only in the ordering and limit. --- app/controllers/bubbles_controller.rb | 5 +---- app/views/bubbles/index.html.erb | 5 +++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/controllers/bubbles_controller.rb b/app/controllers/bubbles_controller.rb index 0ec5371a6..d4a475cb0 100644 --- a/app/controllers/bubbles_controller.rb +++ b/app/controllers/bubbles_controller.rb @@ -4,18 +4,15 @@ class BubblesController < ApplicationController before_action :set_bubble, only: %i[ show edit update ] def index - @bubbles = @bucket.bubbles.not_popped.reverse_chronologically + @bubbles = @bucket.bubbles.not_popped if params[:filter].present? @bubbles = @bubbles.mentioning(params[:filter]) end - @most_active_bubbles = @bubbles.ordered_by_activity.limit(10) - if params[:tag_id] @tag = Current.account.tags.find(params[:tag_id]) @bubbles = @bubbles.tagged_with(@tag) - @most_active_bubbles = @most_active_bubbles.tagged_with(@tag) end end diff --git a/app/views/bubbles/index.html.erb b/app/views/bubbles/index.html.erb index ba5a09e6c..e66d86389 100644 --- a/app/views/bubbles/index.html.erb +++ b/app/views/bubbles/index.html.erb @@ -100,7 +100,7 @@ <% end %>
- <%= render @most_active_bubbles %> + <%= render partial: "bubbles/bubble", collection: @bubbles.ordered_by_activity.limit(10) %>
@@ -109,7 +109,8 @@ +