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
there should be no two separate ClassMethods modules defined in same file
Ivan Kuchin8d1f23ddc60a
diff --git a/lib_static/open_project/acts/watchable.rb b/lib_static/open_project/acts/watchable.rbindex 7a0bc56e232..657d92204d6 100644--- a/lib_static/open_project/acts/watchable.rb+++ b/lib_static/open_project/acts/watchable.rb@@ -91,6 +91,10 @@ module OpenProjectendmodule InstanceMethods+ def self.prepended(base)+ base.extend AddClassMethods+ end+def possible_watcher?(user)user.allowed_based_on_permission_context?(self.class.acts_as_watchable_permission,project:,@@ -156,7 +160,7 @@ module OpenProjectwatcher_user_ids.any? { |uid| uid == user.id })end- module ClassMethods+ module AddClassMethodsdef acts_as_watchable_permissionacts_as_watchable_options[:permission] || :"view_#{name.underscore.pluralize}"enddiff --git a/lib_static/plugins/acts_as_customizable/lib/acts_as_customizable.rb b/lib_static/plugins/acts_as_customizable/lib/acts_as_customizable.rbindex 88e9ec7eb1f..103a3db31a6 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@@ -60,6 +60,7 @@ module Redminemodule InstanceMethodsdef self.included(base)+ base.extend AddClassMethodsbase.extend HumanAttributeNameend@@ -437,7 +438,7 @@ module Redmine@custom_field_values_cache ||= {}end- module ClassMethods+ module AddClassMethodsdef available_custom_fields(_model)RequestStore.fetch(:"#{name.underscore}_custom_fields") doCustomField.where(type: "#{name}CustomField").order(:position)diff --git a/lib_static/plugins/acts_as_event/lib/acts_as_event.rb b/lib_static/plugins/acts_as_event/lib/acts_as_event.rbindex 3110a7003cb..cb594318001 100644--- a/lib_static/plugins/acts_as_event/lib/acts_as_event.rb+++ b/lib_static/plugins/acts_as_event/lib/acts_as_event.rb@@ -92,9 +92,6 @@ module Redmineoptionendend-- module ClassMethods- endendendenddiff --git a/lib_static/plugins/acts_as_searchable/lib/acts_as_searchable.rb b/lib_static/plugins/acts_as_searchable/lib/acts_as_searchable.rbindex fdedbe088c0..24f4bc4fb3e 100644--- a/lib_static/plugins/acts_as_searchable/lib/acts_as_searchable.rb+++ b/lib_static/plugins/acts_as_searchable/lib/acts_as_searchable.rb@@ -73,7 +73,11 @@ module Redmineendmodule InstanceMethods- module ClassMethods+ def self.included(base)+ base.extend AddClassMethods+ end++ module AddClassMethods# Searches the model for the given tokens# projects argument can be either nil (will search all projects), a project or an array of projects# Returns the results and the results count