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
enable rails 6.0 settings
ulferts8cb69deb14df
diff --git a/config/application.rb b/config/application.rbindex 1ae7d02e335..818fe1798e0 100644--- a/config/application.rb+++ b/config/application.rb@@ -248,9 +248,6 @@ module OpenProjectconfig.action_controller.asset_host = OpenProject::Configuration::AssetHost.value- # Return false instead of self when enqueuing is aborted from a callback.- # Rails.application.config.active_job.return_false_on_aborted_enqueue = true-config.log_level = OpenProject::Configuration["log_level"].to_sym# Enable the Rails 7 cache formatdiff --git a/config/initializers/new_framework_defaults_6_0.rb b/config/initializers/new_framework_defaults_6_0.rbindex 9c2269d9207..e1347cc4be7 100644--- a/config/initializers/new_framework_defaults_6_0.rb+++ b/config/initializers/new_framework_defaults_6_0.rb@@ -1,3 +1,33 @@+# frozen_string_literal: true++# -- copyright+# OpenProject is an open source project management software.+# Copyright (C) the OpenProject GmbH+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License version 3.+#+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+# Copyright (C) 2006-2013 Jean-Philippe Lang+# Copyright (C) 2010-2013 the ChiliProject Team+#+# This program is free software; you can redistribute it and/or+# modify it under the terms of the GNU General Public License+# as published by the Free Software Foundation; either version 2+# of the License, or (at your option) any later version.+#+# This program is distributed in the hope that it will be useful,+# but WITHOUT ANY WARRANTY; without even the implied warranty of+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+# GNU General Public License for more details.+#+# You should have received a copy of the GNU General Public License+# along with this program; if not, write to the Free Software+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+#+# See COPYRIGHT and LICENSE files for more details.+# +++# Be sure to restart your server when you modify this file.## This file contains migration options to ease your Rails 6.0 upgrade.@@ -9,7 +39,7 @@# https://guides.rubyonrails.org/configuring.html#config-action-view-default-enforce-utf8# Don't force requests from old versions of IE to be UTF-8 encoded.# Previous versions had true. Rails 6.0+ default is false.-# Rails.application.config.action_view.default_enforce_utf8 = false+Rails.application.config.action_view.default_enforce_utf8 = false# https://guides.rubyonrails.org/configuring.html#config-action-dispatch-use-cookies-with-metadata# Embed purpose and expiry metadata inside signed and encrypted@@ -18,13 +48,13 @@# This option is not backwards compatible with earlier Rails versions.# It's best enabled when your entire app is migrated and stable on 6.0.# Rails 6.0+ default is true.-# Rails.application.config.action_dispatch.use_cookies_with_metadata = true+Rails.application.config.action_dispatch.use_cookies_with_metadata = true# Change the return value of `ActionDispatch::Response#content_type` to Content-Type header without modification.-# Rails.application.config.action_dispatch.return_only_media_type_on_content_type = false+Rails.application.config.action_dispatch.return_only_media_type_on_content_type = false# Return false instead of self when enqueuing is aborted from a callback.-# Rails.application.config.active_job.return_false_on_aborted_enqueue = true+Rails.application.config.active_job.return_false_on_aborted_enqueue = true# https://guides.rubyonrails.org/configuring.html#config-active-storage-queues-analysis# https://guides.rubyonrails.org/configuring.html#config-active-storage-queues-purge@@ -44,7 +74,7 @@# When assigning to a collection of attachments declared via `has_many_attached`, replace existing# attachments instead of appending. Use #attach to add new attachments without replacing existing ones.# Previous versions had false. Rails 6.0+ default is true.-# Rails.application.config.active_storage.replace_on_assign_to_many = true+Rails.application.config.active_storage.replace_on_assign_to_many = true# https://guides.rubyonrails.org/configuring.html#config-action-mailer-delivery-job# Use ActionMailer::MailDeliveryJob for sending parameterized and normal mail.@@ -54,14 +84,14 @@# If you send mail in the background, job workers need to have a copy of# MailDeliveryJob to ensure all delivery jobs are processed properly.# Make sure your entire app is migrated and stable on 6.0 before using this setting.-# Rails.application.config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob"+Rails.application.config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob"# https://guides.rubyonrails.org/configuring.html#config-active-record-collection-cache-versioning# Enable the same cache key to be reused when the object being cached of type# `ActiveRecord::Relation` changes by moving the volatile information (max updated at and count)# of the relation's cache key into the cache version to support recycling cache key.# Previous versions had false. Rails 6.0+ default is true.-# Rails.application.config.active_record.collection_cache_versioning = true+Rails.application.config.active_record.collection_cache_versioning = true# Enable the new autoloader zeitwerk for autoloading and reloading constants-# Rails.application.config.autoloader = :zeitwerk if RUBY_ENGINE == "ruby"+Rails.application.config.autoloader = :zeitwerk if RUBY_ENGINE == "ruby"diff --git a/config/initializers/new_framework_defaults_6_1.rb b/config/initializers/new_framework_defaults_6_1.rbindex 978d9162e15..aa53f61afe5 100644--- a/config/initializers/new_framework_defaults_6_1.rb+++ b/config/initializers/new_framework_defaults_6_1.rb@@ -62,13 +62,13 @@# Set the default queue name for the analysis job to the queue adapter default.# Rails 6.0 used :active_storage_analysis.# Rails 6.1+ default is nil (when nil, default Active Job queue is used).-# Rails.application.config.active_storage.queues.analysis = nil+Rails.application.config.active_storage.queues.analysis = nil# https://guides.rubyonrails.org/configuring.html#config-active-storage-queues-purge# Set the default queue name for the purge job to the queue adapter default.# Rails 6.0 used :active_storage_purge.# Rails 6.1+ default is nil (when nil, default Active Job queue is used).-# Rails.application.config.active_storage.queues.purge = nil+Rails.application.config.active_storage.queues.purge = nil# https://guides.rubyonrails.org/configuring.html#config-action-mailbox-queues-incineration# Set the default queue name for the incineration job to the queue adapter default.diff --git a/modules/bim/app/views/bim/ifc_models/ifc_models/_form.html.erb b/modules/bim/app/views/bim/ifc_models/ifc_models/_form.html.erbindex 66e2b7fb6f0..2ad5e07e45f 100644--- a/modules/bim/app/views/bim/ifc_models/ifc_models/_form.html.erb+++ b/modules/bim/app/views/bim/ifc_models/ifc_models/_form.html.erb@@ -114,22 +114,19 @@ See COPYRIGHT and LICENSE files for more details.setDirectUploadFileName();<%# rebuild form to post to S3 directly %>- if (jQuery("input[name=utf8]").length == 1) {- jQuery("input[name=utf8]").remove();- jQuery("input[name=authenticity_token]").remove();- jQuery("input[name=_method]").remove();+ jQuery("input[name=authenticity_token]").remove();+ jQuery("input[name=_method]").remove();- var url = jQuery("input[name=uri]").val();+ var url = jQuery("input[name=uri]").val();- jQuery("form").attr("action", url);- jQuery("form").attr("enctype", "multipart/form-data");+ jQuery("form").attr("action", url);+ jQuery("form").attr("enctype", "multipart/form-data");- jQuery("input[name=uri]").remove();+ jQuery("input[name=uri]").remove();- jQuery("form").submit(function() {- jQuery("#bim_ifc_models_ifc_model_title").prop("disabled", "disabled");- });- }+ jQuery("form").submit(function() {+ jQuery("#bim_ifc_models_ifc_model_title").prop("disabled", "disabled");+ });});<% unless @ifc_model.new_record? %><%# The titleField might have changed AFTER selecting a file. Therefore,diff --git a/modules/storages/spec/features/storages/admin/edit_storage_spec.rb b/modules/storages/spec/features/storages/admin/edit_storage_spec.rbindex d4a7676db46..e95ed788451 100644--- a/modules/storages/spec/features/storages/admin/edit_storage_spec.rb+++ b/modules/storages/spec/features/storages/admin/edit_storage_spec.rb@@ -46,7 +46,7 @@ RSpec.describe "Admin Edit File storage",page.find_test_selector("storage-delete-button").clickexpect(page).to have_text("DELETE FILE STORAGE")- expect(page).to have_current_path("#{confirm_destroy_admin_settings_storage_path(storage)}?utf8=%E2%9C%93")+ expect(page).to have_current_path(confirm_destroy_admin_settings_storage_path(storage))storage_delete_button = page.find_button("Delete", disabled: true)fill_in("delete_confirmation", with: "Foo Nextcloud")diff --git a/modules/storages/spec/features/storages/admin/project_storages_spec.rb b/modules/storages/spec/features/storages/admin/project_storages_spec.rbindex a8b3a2f53f9..1443a649d51 100644--- a/modules/storages/spec/features/storages/admin/project_storages_spec.rb+++ b/modules/storages/spec/features/storages/admin/project_storages_spec.rb@@ -182,7 +182,7 @@ RSpec.describe "Admin lists project mappings for a storage",page.find_test_selector("storage-delete-button").clickexpect(page).to have_text("DELETE FILE STORAGE")- expect(page).to have_current_path("#{confirm_destroy_admin_settings_storage_path(storage)}?utf8=%E2%9C%93")+ expect(page).to have_current_path(confirm_destroy_admin_settings_storage_path(storage))enddescribe "Linking a project to a storage with a manually managed folder" dodiff --git a/spec/lib/open_project/form_tag_helper_spec.rb b/spec/lib/open_project/form_tag_helper_spec.rbindex 4350ecc37bc..1ca30cca8a4 100644--- a/spec/lib/open_project/form_tag_helper_spec.rb+++ b/spec/lib/open_project/form_tag_helper_spec.rb@@ -1,4 +1,6 @@-#-- copyright+# frozen_string_literal: true++# -- copyright# OpenProject is an open source project management software.# Copyright (C) the OpenProject GmbH#@@ -24,7 +26,7 @@# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.## See COPYRIGHT and LICENSE files for more details.-#+++# ++require "spec_helper"@@ -43,8 +45,7 @@ RSpec.describe OpenProject::FormTagHelper, type: :helper doit "outputs element" doexpect(output).to be_html_eql(%{<form accept-charset="UTF-8" action="/feedback" class="form"- method="post"><input name="utf8"- type="hidden" value="✓" autocomplete="off" /><p>Form content</p></form>+ method="post"><p>Form content</p></form>})endend