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

handle old project_attributes event type filter

Ivan Kuchinbd7e7b218aef
diff --git a/app/models/activities/fetcher.rb b/app/models/activities/fetcher.rb
index 886ea1cfef7..36f07ccbf8d 100644
--- a/app/models/activities/fetcher.rb
+++ b/app/models/activities/fetcher.rb
@@ -81,7 +81,11 @@ module Activities
when :default
default_scope!
else
- @scope = Array(scope) & event_types
+ scope = Array(scope)
+
+ scope << "project_details" if scope.delete("project_attributes")
+
+ @scope = scope & event_types
end
end
diff --git a/spec/models/activities/fetcher_integration_spec.rb b/spec/models/activities/fetcher_integration_spec.rb
index 7e510493816..6d3ff9aa4dc 100644
--- a/spec/models/activities/fetcher_integration_spec.rb
+++ b/spec/models/activities/fetcher_integration_spec.rb
@@ -104,6 +104,15 @@ RSpec.describe Activities::Fetcher, "integration" do
.to match_array(activities_of_types(Message, TimeEntry, Project))
end
end
+
+ context "with scope of compatibility alias of project_attributes for project_details" do
+ before { options[:scope] = %w[project_attributes] }
+
+ it "finds only events matching the scope" do
+ expect(event_journables)
+ .to match_array(activities_of_types(Project))
+ end
+ end
end
context "for global activities" do