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
store class names instead of classes in acts_as_ registries
Ivan Kuchin4b37ca85e60a
diff --git a/lib_static/open_project/acts/registry_methods.rb b/lib_static/open_project/acts/registry_methods.rbindex 2e7ffabd2c3..ff0f275d370 100644--- a/lib_static/open_project/acts/registry_methods.rb+++ b/lib_static/open_project/acts/registry_methods.rb@@ -30,7 +30,9 @@ module OpenProjectmodule Actsmodule RegistryMethodsdef instance(model_name)- models.detect { |cls| cls.name == model_name.singularize.camelize }+ class_name = model_name.singularize.camelize++ class_name.constantize if class_names.include?(class_name)enddef add(*models)@@ -42,14 +44,14 @@ module OpenProjectraise ArgumentError.new("Model #{model} does not include #{acts_as_method_name}")end- self.models << model+ class_names << model.nameendendprivate- def models- @models ||= Set.new+ def class_names+ @class_names ||= Set.newendendend