Scope tags by bucket
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user