Scope tags by bucket

This commit is contained in:
Jeffrey Hardy
2024-10-07 09:03:17 -04:00
parent 65f29ae3b5
commit d38bab9664
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -5,6 +5,7 @@ class Bucket < ApplicationRecord
belongs_to :creator, class_name: "User", default: -> { Current.user }
has_many :bubbles, dependent: :destroy
has_many :tags, -> { distinct }, through: :bubbles
validates_presence_of :name
end
+1 -1
View File
@@ -47,7 +47,7 @@
<dialog class="filter__popup panel fill-white shadow" data-dialog-target="dialog">
<menu class="filter__menu unpad margin-none">
<% Current.account.tags.order(:title).each do |tag| %>
<% bucket.tags.order(:title).each do |tag| %>
<li><%= link_to tag.title, bucket_bubbles_path(bucket, bubble_filter_params.merge(tag_id: tag.id)) %></li>
<% end %>
</menu>