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
Raise error when trying to call acts_as_favorable without registering
Oliver Günther5cbd60409eae
diff --git a/lib_static/open_project/acts/favorable.rb b/lib_static/open_project/acts/favorable.rbindex 7c830bd8d11..3a039013a97 100644--- a/lib_static/open_project/acts/favorable.rb+++ b/lib_static/open_project/acts/favorable.rb@@ -48,6 +48,10 @@ module OpenProjectdef acts_as_favorablereturn 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+class_eval dohas_many :favorites, as: :favored, dependent: :delete_all, validate: falsehas_many :favoring_users, through: :favorites, source: :user, validate: false