Files
fizzy/app/models/bucket.rb
T
Kevin McConnell e7bc04856f Broadcast bucket changes to index page
This will cause each filtered view to stay updated as the items in the
buckets change.

For filters that are specific to buckets, we listen to broadcasts on
those buckets; for filters on "All projects" we listen instead for
broadcasts on an account-specific channel. This is so that "All
projects" views will be aware of any new buckets that are added, while
also avoid unnecessary refreshes from buckets that are filtered out.
2025-01-09 09:14:22 +00:00

12 lines
306 B
Ruby

class Bucket < ApplicationRecord
include Accessible, Broadcastable, Filterable
belongs_to :account
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