Skip to content

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

fixup! avoid N+1 query for /api/v3/days endpoint

Christophe Bliarda916c7580357
diff --git a/app/models/day.rb b/app/models/day.rb
index 15b77503735..f73b4258c48 100644
--- a/app/models/day.rb
+++ b/app/models/day.rb
@@ -47,6 +47,7 @@ class Day < ApplicationRecord
to = today.next_month.at_end_of_month
select('days.*')
+ .includes(:week_day)
.from(Arel.sql(from_sql(from:, to:)))
end