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

avoid creating a journal for a to be destroyed work package

ulferts2b43c550b31f
diff --git a/app/models/work_package.rb b/app/models/work_package.rb
index fa5db624518..6d33bbaa208 100644
--- a/app/models/work_package.rb
+++ b/app/models/work_package.rb
@@ -163,8 +163,7 @@ class WorkPackage < ApplicationRecord
# test_destroying_root_projects_should_clear_data #
# for details. #
###################################################
- acts_as_attachable after_remove: :attachments_changed,
- order: "#{Attachment.table_name}.file",
+ acts_as_attachable order: "#{Attachment.table_name}.file",
add_on_new_permission: :add_work_packages,
add_on_persisted_permission: :edit_work_packages,
modification_blocked: ->(*) { readonly_status? },
diff --git a/spec/models/work_package/work_package_acts_as_journalized_spec.rb b/spec/models/work_package/work_package_acts_as_journalized_spec.rb
index 3f687182629..6e4521deb34 100644
--- a/spec/models/work_package/work_package_acts_as_journalized_spec.rb
+++ b/spec/models/work_package/work_package_acts_as_journalized_spec.rb
@@ -299,18 +299,6 @@ describe WorkPackage, type: :model do
it { is_expected.to eq(@original_journal_count) }
end
-
- context 'attachment removed' do
- before do
- work_package.attachments.delete(attachment)
- end
-
- subject { work_package.journals.reload.last.details }
-
- it { is_expected.to have_key attachment_id }
-
- it { expect(subject[attachment_id]).to eq([attachment.filename, nil]) }
- end
end
context 'custom values', with_settings: { journal_aggregation_time_minutes: 0 } do