Files
fizzy/app/controllers/readings_controller.rb
T
2025-01-16 17:48:38 +00:00

14 lines
362 B
Ruby

class ReadingsController < ApplicationController
include BubbleScoped, BucketScoped
def create
mark_bubble_notifications_read
@notifications = Current.user.notifications.unread.ordered.limit(20)
end
private
def mark_bubble_notifications_read
Current.user.notifications.where(bubble: @bubble).update(read_at: Time.current)
end
end