diff --git a/app/controllers/pseuds_controller.rb b/app/controllers/pseuds_controller.rb index 77265c9cca7..f71c4ddf8e3 100644 --- a/app/controllers/pseuds_controller.rb +++ b/app/controllers/pseuds_controller.rb @@ -91,7 +91,7 @@ def create # if setting this one as default, unset the attribute of the current default pseud old_default.update_attribute(:is_default, false) end - redirect_to([@user, @pseud]) + redirect_to polymorphic_path([@user, @pseud]) else render action: "new" end diff --git a/config/application.rb b/config/application.rb index 992db9c0a25..318f40bc5fc 100644 --- a/config/application.rb +++ b/config/application.rb @@ -17,7 +17,7 @@ class Application < Rails::Application # These settings can be overridden in specific environments using the files # in config/environments, which are processed later. - config.load_defaults 6.1 + config.load_defaults 7.0 # TODO: Remove in Rails 7.1, where it's false by default. config.add_autoload_paths_to_load_path = false diff --git a/config/initializers/cookie_rotator.rb b/config/initializers/cookie_rotator.rb deleted file mode 100644 index 1ca6f61d529..00000000000 --- a/config/initializers/cookie_rotator.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -# As part of the Rails 7 upgrade, we need to convert legacy (SHA1) cookies to SHA256. -# This can be removed after it has been in production for a little bit. -# Ref: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#key-generator-digest-class-change-requires-a-cookie-rotator -Rails.application.config.after_initialize do - Rails.application.config.action_dispatch.cookies_rotations.tap do |cookies| - authenticated_encrypted_cookie_salt = Rails.application.config.action_dispatch.authenticated_encrypted_cookie_salt - signed_cookie_salt = Rails.application.config.action_dispatch.signed_cookie_salt - - secret_key_base = Rails.application.secret_key_base - - key_generator = ActiveSupport::KeyGenerator.new( - secret_key_base, iterations: 1000, hash_digest_class: OpenSSL::Digest::SHA1 - ) - key_len = ActiveSupport::MessageEncryptor.key_len - - old_encrypted_secret = key_generator.generate_key(authenticated_encrypted_cookie_salt, key_len) - old_signed_secret = key_generator.generate_key(signed_cookie_salt) - - cookies.rotate :encrypted, old_encrypted_secret - cookies.rotate :signed, old_signed_secret - end -end diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb deleted file mode 100644 index f51a497e118..00000000000 --- a/config/initializers/cookies_serializer.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Specify a serializer for the signed and encrypted cookie jars. -# Valid options are :json, :marshal, and :hybrid. -Rails.application.config.action_dispatch.cookies_serializer = :hybrid diff --git a/config/initializers/new_framework_defaults_7_0.rb b/config/initializers/new_framework_defaults_7_0.rb deleted file mode 100644 index aa327f1102f..00000000000 --- a/config/initializers/new_framework_defaults_7_0.rb +++ /dev/null @@ -1,110 +0,0 @@ -# Be sure to restart your server when you modify this file. -# -# This file eases your Rails 7.0 framework defaults upgrade. -# -# Uncomment each configuration one by one to switch to the new default. -# Once your application is ready to run with all new defaults, you can remove -# this file and set the `config.load_defaults` to `7.0`. -# -# Read the Guide for Upgrading Ruby on Rails for more info on each option. -# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html - -# `button_to` view helper will render `