Scope bubble query by project

This commit is contained in:
Jeffrey Hardy
2024-09-18 13:17:31 -04:00
parent 355e144ddc
commit 72bf68a0c8
+1 -1
View File
@@ -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