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

adapt storage`s peripheral contracts

ulfertsc56679bd96a5
diff --git a/modules/storages/app/contracts/storages/storages/base_contract.rb b/modules/storages/app/contracts/storages/storages/base_contract.rb
index 9054f72313a..b991ba9c26a 100644
--- a/modules/storages/app/contracts/storages/storages/base_contract.rb
+++ b/modules/storages/app/contracts/storages/storages/base_contract.rb
@@ -59,8 +59,13 @@ module Storages::Storages
# to the list of writable attributes.
# Otherwise, we get :readonly validation errors.
contract.writable_attributes.append(*writable_attributes)
+
+ # Validating the contract will clear the errors
+ # of this contract so we save them for later.
+ former_errors = errors.dup
+
contract.validate
- errors.merge!(contract.errors)
+ errors.merge!(former_errors)
end
end
end