Remove redundant ordering for most-active bubbles
The base bubbles query is the same, differing only in the ordering and limit.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
<% end %>
|
||||
|
||||
<section class="windshield flex-inline flex-wrap gap justify-center align-end" style="view-transition-name: windshield_<%= @bucket.id %>">
|
||||
<%= render @most_active_bubbles %>
|
||||
<%= render partial: "bubbles/bubble", collection: @bubbles.ordered_by_activity.limit(10) %>
|
||||
</section>
|
||||
|
||||
<section class="bubbles-list unpad-inline center margin-block-start">
|
||||
@@ -109,7 +109,8 @@
|
||||
<input type="search" name="filter" class="input center flex-inline" placeholder="Type to filter…" value="<%= params[:filter] %>">
|
||||
</form>
|
||||
</header>
|
||||
|
||||
<ul class="unpad margin-none flex flex-column txt-align-start center">
|
||||
<%= render partial: "bubbles/list/bubble", collection: @bubbles %>
|
||||
<%= render partial: "bubbles/list/bubble", collection: @bubbles.reverse_chronologically %>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user