Files
fizzy/app/controllers/bubbles/watches_controller.rb
T
Kevin McConnell 0820badcc3 Add involvement types to accesses
This provides a way to set the level of involvement that a user has with
a collection, and from which we determine the level of notifications to
send. Users can be access-only, watching, or being notified about
everything.

If you're access-only, you won't get an notifications. If you're
watching, you'll only get notifications for the items you're watching
(which includes the items you've been assigned, have commented on, etc).
If you're set to everything you'll get notifications about all activity
in that collection.

This change replaces our previous concept of subscriptions. Where
previously you'd subscribe to a collection to get notifications in it,
now you'll simply set the notification level on your access.
2025-04-03 16:35:13 +01:00

18 lines
387 B
Ruby

class Bubbles::WatchesController < ApplicationController
include BubbleScoped, BucketScoped
def create
set_watching_and_redirect(true)
end
def destroy
set_watching_and_redirect(false)
end
private
def set_watching_and_redirect(watching)
@bubble.set_watching(Current.user, watching)
redirect_to bucket_bubble_watch_path(@bucket, @bubble)
end
end