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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
move to proper module
ulferts3b0f7367fd35
diff --git a/app/contracts/work_packages/base_contract.rb b/app/contracts/work_packages/base_contract.rbindex a5142780a03..6d4ef5981d1 100644--- a/app/contracts/work_packages/base_contract.rb+++ b/app/contracts/work_packages/base_contract.rb@@ -208,7 +208,7 @@ module WorkPackagesenddef validate_assigned_to_exists- errors.add :assigned_to, :does_not_exist if model.assigned_to&.is_a?(User::InexistentUser)+ errors.add :assigned_to, :does_not_exist if model.assigned_to&.is_a?(Users::InexistentUser)enddef validate_type_existsdiff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rbindex 9fe8025cad3..75b7fd84864 100644--- a/app/helpers/users_helper.rb+++ b/app/helpers/users_helper.rb@@ -35,7 +35,7 @@ module UsersHelper# @param extra [Hash] A hash containing extra entries with a count for each.# For example: { random: 42 }def users_status_options_for_select(selected, extra: {})- statuses = User::StatusOptions.user_statuses_with_count extra: extra+ statuses = Users::StatusOptions.user_statuses_with_count extra: extraoptions = statuses.map do |sym, count|["#{translate_user_status(sym)} (#{count})", sym]diff --git a/app/models/user.rb b/app/models/user.rbindex 4973b627d18..a16dd216ff0 100644--- a/app/models/user.rb+++ b/app/models/user.rb@@ -207,7 +207,7 @@ class User < Principal@name = nil@projects_by_role = nil@authorization_service = ::Authorization::UserAllowedService.new(self)- @project_role_cache = ::User::ProjectRoleCache.new(self)+ @project_role_cache = ::Users::ProjectRoleCache.new(self)superend@@ -776,7 +776,7 @@ class User < Principalenddef project_role_cache- @project_role_cache ||= ::User::ProjectRoleCache.new(self)+ @project_role_cache ||= ::Users::ProjectRoleCache.new(self)enddef former_passwords_include?(password)diff --git a/app/models/user/inexistent_user.rb b/app/models/users/inexistent_user.rbsimilarity index 96%rename from app/models/user/inexistent_user.rbrename to app/models/users/inexistent_user.rbindex 85c95b2c3b1..e6b253396b9 100644--- a/app/models/user/inexistent_user.rb+++ b/app/models/users/inexistent_user.rb@@ -28,4 +28,4 @@# See docs/COPYRIGHT.rdoc for more details.#++-class User::InexistentUser < User; end+class Users::InexistentUser < User; enddiff --git a/app/models/user/project_authorization_cache.rb b/app/models/users/project_authorization_cache.rbsimilarity index 98%rename from app/models/user/project_authorization_cache.rbrename to app/models/users/project_authorization_cache.rbindex 037a202eb0b..c52f066b591 100644--- a/app/models/user/project_authorization_cache.rb+++ b/app/models/users/project_authorization_cache.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-class User::ProjectAuthorizationCache+class Users::ProjectAuthorizationCacheattr_accessor :userdef initialize(user)diff --git a/app/models/user/project_role_cache.rb b/app/models/users/project_role_cache.rbsimilarity index 98%rename from app/models/user/project_role_cache.rbrename to app/models/users/project_role_cache.rbindex 58ff7a3ba79..270165af2e2 100644--- a/app/models/user/project_role_cache.rb+++ b/app/models/users/project_role_cache.rb@@ -28,7 +28,7 @@# See docs/COPYRIGHT.rdoc for more details.#++-class User::ProjectRoleCache+class Users::ProjectRoleCacheattr_accessor :userdef initialize(user)diff --git a/app/models/user/status_options.rb b/app/models/users/status_options.rbsimilarity index 99%rename from app/models/user/status_options.rbrename to app/models/users/status_options.rbindex e53e76c5793..eca759845fe 100644--- a/app/models/user/status_options.rb+++ b/app/models/users/status_options.rb@@ -1,4 +1,4 @@-class User+module Usersmodule StatusOptionsmodule_functiondiff --git a/app/services/authorization/user_allowed_service.rb b/app/services/authorization/user_allowed_service.rbindex 78d9f98d140..1399ccb6886 100644--- a/app/services/authorization/user_allowed_service.rb+++ b/app/services/authorization/user_allowed_service.rb@@ -31,7 +31,7 @@class Authorization::UserAllowedServiceattr_accessor :user- def initialize(user, role_cache: User::ProjectRoleCache.new(user))+ def initialize(user, role_cache: Users::ProjectRoleCache.new(user))self.user = userself.project_role_cache = role_cacheend@@ -114,7 +114,7 @@ class Authorization::UserAllowedServiceenddef project_authorization_cache- @project_authorization_cache ||= User::ProjectAuthorizationCache.new(user)+ @project_authorization_cache ||= Users::ProjectAuthorizationCache.new(user)enddef normalize_action(action)diff --git a/modules/bim/app/services/bim/bcf/issues/transform_attributes_service.rb b/modules/bim/app/services/bim/bcf/issues/transform_attributes_service.rbindex 77e6fd5e8cb..701dd648c02 100644--- a/modules/bim/app/services/bim/bcf/issues/transform_attributes_service.rb+++ b/modules/bim/app/services/bim/bcf/issues/transform_attributes_service.rb@@ -160,7 +160,7 @@ module Bim::Bcfdef missing_assignee(assignee_name, import_options)if import_options[:invalid_people_action] != 'anonymize' && assignee_name- User::InexistentUser.new+ Users::InexistentUser.newendendenddiff --git a/spec/contracts/work_packages/base_contract_spec.rb b/spec/contracts/work_packages/base_contract_spec.rbindex 27e97e50b99..62c1ff915f6 100644--- a/spec/contracts/work_packages/base_contract_spec.rb+++ b/spec/contracts/work_packages/base_contract_spec.rb@@ -664,7 +664,7 @@ describe WorkPackages::BaseContract docontext 'assigned_to' docontext 'inexistent user' dobefore do- work_package.assigned_to = User::InexistentUser.new+ work_package.assigned_to = Users::InexistentUser.newcontract.validateenddiff --git a/spec/services/authorization/user_allowed_service_spec.rb b/spec/services/authorization/user_allowed_service_spec.rbindex c93409110c1..f9e3c97e5b8 100644--- a/spec/services/authorization/user_allowed_service_spec.rb+++ b/spec/services/authorization/user_allowed_service_spec.rb@@ -167,7 +167,7 @@ describe Authorization::UserAllowedService dobefore doauth_cache = double('auth_cache')- allow(User::ProjectAuthorizationCache)+ allow(Users::ProjectAuthorizationCache).to receive(:new).and_return(auth_cache)