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

Adds the storable journals to the includes for eager loading the activity records.

Marcello Rocha7ed51257ea7d
diff --git a/lib/api/v3/activities/activities_by_work_package_api.rb b/lib/api/v3/activities/activities_by_work_package_api.rb
index 8a2c0a0d9c0..10a66143f6a 100644
--- a/lib/api/v3/activities/activities_by_work_package_api.rb
+++ b/lib/api/v3/activities/activities_by_work_package_api.rb
@@ -38,6 +38,7 @@ module API
journals = @work_package.journals.includes(:data,
:customizable_journals,
:attachable_journals,
+ :storable_journals,
:bcf_comment)
Activities::ActivityCollectionRepresenter.new(journals,
diff --git a/lib/api/v3/activities/activity_eager_loading_wrapper.rb b/lib/api/v3/activities/activity_eager_loading_wrapper.rb
index db1963d7d25..4c2bf913e78 100644
--- a/lib/api/v3/activities/activity_eager_loading_wrapper.rb
+++ b/lib/api/v3/activities/activity_eager_loading_wrapper.rb
@@ -135,7 +135,7 @@ module API
) AS journals
SQL
)
- .includes(:attachable_journals, :customizable_journals)
+ .includes(:attachable_journals, :customizable_journals, :storable_journals)
end
end
end
diff --git a/spec/requests/api/v3/activities_by_work_package_resource_spec.rb b/spec/requests/api/v3/activities_by_work_package_resource_spec.rb
index 151e552c531..11a5e81d987 100644
--- a/spec/requests/api/v3/activities_by_work_package_resource_spec.rb
+++ b/spec/requests/api/v3/activities_by_work_package_resource_spec.rb
@@ -87,7 +87,7 @@ RSpec.describe API::V3::Activities::ActivitiesByWorkPackageAPI do
include_context 'create activity'
end
- context 'with an errorenous work package' do
+ context 'with an erroneous work package' do
before do
work_package.subject = ''
work_package.save!(validate: false)