9b4169c7ca
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.
17 lines
320 B
Ruby
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
|