Files
fizzy/app/controllers/concerns/bubble_scoped.rb
T
2025-04-05 15:56:12 +02:00

18 lines
404 B
Ruby

module BubbleScoped
extend ActiveSupport::Concern
included do
before_action :set_bubble, :set_bucket
end
private
def set_bubble
# Finding the bubble on the root depends on checking permission by finding its bucket via Current.user
@bubble = Bubble.find(params[:bubble_id])
end
def set_bucket
@bucket = Current.user.buckets.find(@bubble.bucket_id)
end
end