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

Add comment on the ProjectQuery::PublishService and fix typos.

Dombi Attila0f62a79a893b
diff --git a/app/contracts/project_queries/permissions_guard.rb b/app/contracts/project_queries/permissions_guard.rb
index 25be893b580..15b5afff45e 100644
--- a/app/contracts/project_queries/permissions_guard.rb
+++ b/app/contracts/project_queries/permissions_guard.rb
@@ -27,6 +27,7 @@
#
# See COPYRIGHT and LICENSE files for more details.
#++
+
module ProjectQueries
module PermissionsGuard
extend ActiveSupport::Concern
diff --git a/app/contracts/project_queries/publish_contract.rb b/app/contracts/project_queries/publish_contract.rb
index c39cdc1e396..c3477784243 100644
--- a/app/contracts/project_queries/publish_contract.rb
+++ b/app/contracts/project_queries/publish_contract.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
diff --git a/app/services/project_queries/publish_service.rb b/app/services/project_queries/publish_service.rb
index 73c38b63264..ea0b48707d4 100644
--- a/app/services/project_queries/publish_service.rb
+++ b/app/services/project_queries/publish_service.rb
@@ -37,6 +37,9 @@ module ProjectQueries
end
def persist(service_call)
+ # Usually we want to have validations on ProjectQueries, however in this case
+ # it is not required. It would be unusual to show any validation error when the
+ # public switch toggled on the share dialog.
model.save(validate: false)
service_call