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

use any? instead of detect when we need just a boolean

Ivan Kuchin16eac6202c21
diff --git a/app/components/projects/projects_filters_component.rb b/app/components/projects/projects_filters_component.rb
index 058bb1cd7ad..8bd11f2d3b3 100644
--- a/app/components/projects/projects_filters_component.rb
+++ b/app/components/projects/projects_filters_component.rb
@@ -55,6 +55,6 @@ class Projects::ProjectsFiltersComponent < Filter::FilterComponent
]
allowlist << Queries::Filters::Shared::CustomFields::Base if EnterpriseToken.allows_to?(:custom_fields_in_projects_list)
- allowlist.detect { |clazz| filter.is_a? clazz }
+ allowlist.any? { |clazz| filter.is_a? clazz }
end
end
diff --git a/modules/meeting/app/components/meetings/meeting_filters_component.rb b/modules/meeting/app/components/meetings/meeting_filters_component.rb
index f902b97194a..21cc140b5a1 100644
--- a/modules/meeting/app/components/meetings/meeting_filters_component.rb
+++ b/modules/meeting/app/components/meetings/meeting_filters_component.rb
@@ -71,7 +71,7 @@ module Meetings
allowlist << Queries::Meetings::Filters::ProjectFilter
end
- allowlist.detect { |clazz| filter.is_a? clazz }
+ allowlist.any? { |clazz| filter.is_a? clazz }
end
end
end