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

Revert "Try moving the aac validation into the contracts"

Dombi Attila9ae205a4ed03
diff --git a/app/contracts/groups/base_contract.rb b/app/contracts/groups/base_contract.rb
index 540089dc77e..ee0309e789d 100644
--- a/app/contracts/groups/base_contract.rb
+++ b/app/contracts/groups/base_contract.rb
@@ -38,9 +38,6 @@ module Groups
validate :validate_unique_users
- delegate :validate_custom_values, to: :model
- validate :validate_custom_values
-
private
# Validating on the group_users since those are dealt with in the
diff --git a/app/contracts/projects/base_contract.rb b/app/contracts/projects/base_contract.rb
index f9343fa85cc..a894a0e2ffe 100644
--- a/app/contracts/projects/base_contract.rb
+++ b/app/contracts/projects/base_contract.rb
@@ -57,9 +57,6 @@ module Projects
validate :validate_user_allowed_to_manage
- delegate :validate_custom_values, to: :model
- validate :validate_custom_values
-
def assignable_parents
Project
.allowed_to(user, :add_subprojects)
diff --git a/app/contracts/users/base_contract.rb b/app/contracts/users/base_contract.rb
index ac509b515c3..2dfb83fd0c6 100644
--- a/app/contracts/users/base_contract.rb
+++ b/app/contracts/users/base_contract.rb
@@ -62,9 +62,6 @@ module Users
delegate :available_custom_fields, to: :model
- delegate :validate_custom_values, to: :model
- validate :validate_custom_values
-
def reduce_writable_attributes(attributes)
super.tap do |writable|
writable << "password" if password_writable?
diff --git a/app/contracts/versions/base_contract.rb b/app/contracts/versions/base_contract.rb
index 4e28d414557..96178fb42ba 100644
--- a/app/contracts/versions/base_contract.rb
+++ b/app/contracts/versions/base_contract.rb
@@ -42,9 +42,6 @@ module Versions
validate :validate_project_is_set
validate :validate_sharing_included
- delegate :validate_custom_values, to: :model
- validate :validate_custom_values
-
attribute :name
attribute :description
attribute :start_date
diff --git a/app/contracts/work_packages/base_contract.rb b/app/contracts/work_packages/base_contract.rb
index 334de075fe5..a43c9ef9527 100644
--- a/app/contracts/work_packages/base_contract.rb
+++ b/app/contracts/work_packages/base_contract.rb
@@ -154,9 +154,6 @@ module WorkPackages
validate :validate_duration_and_dates_are_not_derivable
- delegate :validate_custom_values, to: :model
- validate :validate_custom_values
-
def initialize(work_package, user, options: {})
super
diff --git a/lib_static/plugins/acts_as_customizable/lib/acts_as_customizable.rb b/lib_static/plugins/acts_as_customizable/lib/acts_as_customizable.rb
index dcc6c0fbf1d..e95c846b5b2 100644
--- a/lib_static/plugins/acts_as_customizable/lib/acts_as_customizable.rb
+++ b/lib_static/plugins/acts_as_customizable/lib/acts_as_customizable.rb
@@ -49,7 +49,7 @@ module Redmine
dependent: :delete_all,
validate: false,
autosave: true
-
+ validate :validate_custom_values
send :include, Redmine::Acts::Customizable::InstanceMethods
before_save :ensure_custom_values_complete