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
Specify `API::V3::Notifications::PropertyFactory` to look up descendants
Kabiru Mwenjafe32e9562618
diff --git a/lib/api/v3/notifications/property_factory.rb b/lib/api/v3/notifications/property_factory.rbindex f5786d253ef..5b450656df9 100644--- a/lib/api/v3/notifications/property_factory.rb+++ b/lib/api/v3/notifications/property_factory.rb@@ -88,12 +88,7 @@ module API::V3::Notificationsend@concrete_factory_for ||= Hash.new do |h, property_key|- h[property_key] = if property_key == "shared"- # for some reasons- # API::V3::Notifications::PropertyFactory.const_defined?(property_key.camelcase)- # returns true for shared only to fail on the constantize later on.- API::V3::Notifications::PropertyFactory::Default- elsif API::V3::Notifications::PropertyFactory.const_defined?(property_key.camelcase)+ h[property_key] = if API::V3::Notifications::PropertyFactory.const_defined?(property_key.camelcase, false)"API::V3::Notifications::PropertyFactory::#{property_key.camelcase}".constantizeelseAPI::V3::Notifications::PropertyFactory::Defaultdiff --git a/spec/lib/api/v3/notifications/notification_representer_rendering_spec.rb b/spec/lib/api/v3/notifications/notification_representer_rendering_spec.rbindex f146213883d..c0fb12c42cb 100644--- a/spec/lib/api/v3/notifications/notification_representer_rendering_spec.rb+++ b/spec/lib/api/v3/notifications/notification_representer_rendering_spec.rb@@ -103,7 +103,7 @@ RSpec.describe API::V3::Notifications::NotificationRepresenter, "rendering" doenddescribe "reason" do- (Notification::REASONS.keys - %i[date_alert_start_date date_alert_due_date reminder]).each do |notification_reason|+ (Notification::REASONS.keys - %i[date_alert_start_date date_alert_due_date]).each do |notification_reason|context "for a #{notification_reason} reason" dolet(:reason) { notification_reason }diff --git a/spec/lib/api/v3/notifications/property_factory_spec.rb b/spec/lib/api/v3/notifications/property_factory_spec.rbindex 653a567d106..3ad53e613c5 100644--- a/spec/lib/api/v3/notifications/property_factory_spec.rb+++ b/spec/lib/api/v3/notifications/property_factory_spec.rb@@ -106,7 +106,7 @@ RSpec.describe API::V3::Notifications::PropertyFactory doendend- (Notification::REASONS.keys - %i[date_alert_start_date date_alert_due_date reminder]).each do |possible_reason|+ (Notification::REASONS.keys - %i[date_alert_start_date date_alert_due_date]).each do |possible_reason|context "for a #{possible_reason} notification" dolet(:reason) { possible_reason }