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

Ensure adding element to registry

Oliver Günther7040daadb52b
diff --git a/lib_static/open_project/acts/favorable.rb b/lib_static/open_project/acts/favorable.rb
index 3a039013a97..3fab37d3280 100644
--- a/lib_static/open_project/acts/favorable.rb
+++ b/lib_static/open_project/acts/favorable.rb
@@ -47,10 +47,7 @@ module OpenProject
# as it's used to identify whether a user can actually favorite the object.
def acts_as_favorable
return if included_modules.include?(::OpenProject::Acts::Favorable::InstanceMethods)
-
- unless ::OpenProject::Acts::Favorable::Registry.exists?(self)
- raise ArgumentError.new("You need to register #{name} to the acts_as_favorable initializer")
- end
+ OpenProject::Acts::Favorable::Registry.add(self)
class_eval do
has_many :favorites, as: :favored, dependent: :delete_all, validate: false