1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-30 19:52:20 +01:00

(bug) add a task for clean abuse notifications

This commit is contained in:
Du Peng 2023-04-17 12:32:01 +02:00
parent acc081a413
commit 4c126a63d5
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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