Files
fizzy/app/controllers/concerns/bubble_scoped.rb
T
Jorge Manrubia 9b4169c7ca Scope data by account
With a single database this problem is not as bad, but it feels
safer to do things right. Also, not everyone in an account has access
to all the bubbles.
2025-04-07 13:09:49 +02:00

17 lines
320 B
Ruby

module BubbleScoped
extend ActiveSupport::Concern
included do
before_action :set_bubble, :set_bucket
end
private
def set_bubble
@bubble = Current.user.accessible_bubbles.find(params[:bubble_id])
end
def set_bucket
@bucket = Current.user.buckets.find(@bubble.bucket_id)
end
end