From 72bf68a0c8553d4248cfcbea4e8c8457025c2db2 Mon Sep 17 00:00:00 2001 From: Jeffrey Hardy Date: Wed, 18 Sep 2024 13:17:31 -0400 Subject: [PATCH] Scope bubble query by project --- app/controllers/bubbles_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/bubbles_controller.rb b/app/controllers/bubbles_controller.rb index 486b38d44..0fbf9d62f 100644 --- a/app/controllers/bubbles_controller.rb +++ b/app/controllers/bubbles_controller.rb @@ -9,7 +9,7 @@ class BubblesController < ApplicationController @bubbles = @tag.bubbles @most_active_bubbles = @tag.bubbles.left_joins(:comments, :boosts).group(:id).order(Arel.sql("COUNT(comments.id) + COUNT(boosts.id) DESC")).limit(10) else - @bubbles = Bubble.all.order(created_at: :desc) + @bubbles = @project.bubbles.order(created_at: :desc) @most_active_bubbles = @project.bubbles.left_joins(:comments, :boosts).group(:id).order(Arel.sql("COUNT(comments.id) + COUNT(boosts.id) DESC")).limit(10) end end