Files
fizzy/app/controllers/cards/readings_controller.rb
T
2025-04-09 14:50:58 +02:00

14 lines
331 B
Ruby

class Cards::ReadingsController < ApplicationController
include CardScoped
def create
mark_card_notifications_read
@notifications = Current.user.notifications.unread.ordered.limit(20)
end
private
def mark_card_notifications_read
Current.user.notifications.unread.where(card: @card).read_all
end
end