Skip to content

Commit

Permalink
Adds the storable journals to the includes for eager loading the acti…
Browse files Browse the repository at this point in the history
…vity records.
  • Loading branch information
mereghost committed Jul 19, 2023
1 parent 6b48768 commit f0994f5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/api/v3/activities/activities_by_work_package_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class ActivitiesByWorkPackageAPI < ::API::OpenProjectAPI
journals = @work_package.journals.includes(:data,
:customizable_journals,
:attachable_journals,
:storable_journals,
:bcf_comment)

Activities::ActivityCollectionRepresenter.new(journals,
Expand Down
2 changes: 1 addition & 1 deletion lib/api/v3/activities/activity_eager_loading_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def predecessor_journals(journals)
) AS journals
SQL
)
.includes(:attachable_journals, :customizable_journals)
.includes(:attachable_journals, :customizable_journals, :storable_journals)
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
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)
Expand Down

0 comments on commit f0994f5

Please sign in to comment.