OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
add simple eager loading to the notifications api
ulferts632f4f15c209
diff --git a/lib/api/v3/notifications/notification_representer.rb b/lib/api/v3/notifications/notification_representer.rbindex 24afbc5bd44..9c3ee2fe596 100644--- a/lib/api/v3/notifications/notification_representer.rb+++ b/lib/api/v3/notifications/notification_representer.rb@@ -100,6 +100,10 @@ module API'Notification'end+ self.to_eager_load = [:project,+ :actor,+ { journal: %i[attachable_journals customizable_journals] }]+### For notifications, we want to skip the initial journal# as the information is not that usefuldiff --git a/lib/api/v3/notifications/notifications_api.rb b/lib/api/v3/notifications/notifications_api.rbindex fb264f0790f..84922f5e94e 100644--- a/lib/api/v3/notifications/notifications_api.rb+++ b/lib/api/v3/notifications/notifications_api.rb@@ -45,7 +45,9 @@ module APIdef notification_scope::Notification.recipient(current_user)- .where.not(reason_ian: nil)+ .includes(NotificationRepresenter.to_eager_load)+ .where+ .not(reason_ian: nil)enddef bulk_update_status(attributes)