+ ##
+ # subscribe to a changeset
+ def subscribe
+ @changeset = Changeset.find(params[:id])
+
+ if request.post?
+ @changeset.subscribe(current_user) unless @changeset.subscribed?(current_user)
+
+ redirect_to changeset_path(@changeset)
+ end
+ rescue ActiveRecord::RecordNotFound
+ render :action => "no_such_entry", :status => :not_found
+ end
+
+ ##
+ # unsubscribe from a changeset
+ def unsubscribe
+ @changeset = Changeset.find(params[:id])
+
+ if request.post?
+ @changeset.unsubscribe(current_user)
+
+ redirect_to changeset_path(@changeset)
+ end
+ rescue ActiveRecord::RecordNotFound
+ render :action => "no_such_entry", :status => :not_found
+ end
+