1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

(feat) Improved performance when marking all notifications as read

This commit is contained in:
Du Peng 2023-07-07 16:17:34 +02:00
parent 9bc146d037
commit b0a204dd1d
2 changed files with 3 additions and 1 deletions

View File

@ -4,6 +4,7 @@
- Fix a bug: unable to update Store Order sub type in statistics
- Fix a bug: unable to create plan with plan limitation
- Ability to show all availabilities in calender for admin
- Improved performance when marking all notifications as read
- [TODO DEPLOY] `rails fablab:maintenance:regenerate_statistics[2014,1]`
## v6.0.8 2023 July 03

View File

@ -65,7 +65,8 @@ class API::NotificationsController < API::APIController
end
def update_all
current_user.notifications.where(is_read: false).find_each(&:mark_as_read)
current_user.notifications.where(is_read: false)
.update_all(is_read: true, updated_at: Time.current) # rubocop:disable Rails/SkipsModelValidations
head :no_content
end