diff --git a/CHANGELOG.md b/CHANGELOG.md index 5458cd199..4b0ef55ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog Fab-manager - Fix a bug: notification is broken when delete a project +- [TODO DEPLOY] `rails fablab:maintenance:clean_abuse_notifications` ## v6.0.3 2023 April 12 diff --git a/lib/tasks/fablab/maintenance.rake b/lib/tasks/fablab/maintenance.rake index 23a6dc4f7..3402555fa 100644 --- a/lib/tasks/fablab/maintenance.rake +++ b/lib/tasks/fablab/maintenance.rake @@ -155,5 +155,12 @@ namespace :fablab do end_date = args.end == 'today' ? Time.current.end_of_day : start_date.next_month [start_date, end_date] end + + desc 'Clean the abuse notifications if signaled object is null' + task clean_abuse_notifications: :environment do + Abuse.all.each do |abuse| + abuse.destroy if abuse.signaled.nil? + end + end end end