From f3cba7b6201b6cd8a9bab7669f791c13d84b3794 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Fri, 1 Mar 2024 22:10:27 +0100 Subject: [PATCH] Set `last_reports_visit` when visiting the reports listing --- app/controllers/moderation/reports_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/controllers/moderation/reports_controller.rb b/app/controllers/moderation/reports_controller.rb index 3bf50ef7..7d29d1b2 100644 --- a/app/controllers/moderation/reports_controller.rb +++ b/app/controllers/moderation/reports_controller.rb @@ -4,6 +4,7 @@ class Moderation::ReportsController < ApplicationController before_action :authenticate_user! before_action :set_filter_enabled before_action :set_type_options + before_action :set_last_reports_visit def index filter = ReportFilter.new(filter_params) @@ -39,4 +40,9 @@ class Moderation::ReportsController < ApplicationController [t("activerecord.models.user.one"), :user] ] end + + def set_last_reports_visit + current_user.last_reports_visit = DateTime.now + current_user.save + end end