A platform for community discussion. Free, open, simple.
DEV: Upgrade to Rails 7.0.3
Loïc Guitaut5fb6dd5664a6
diff --git a/Gemfile b/Gemfileindex bb5d41e03b3..ebacad90a46 100644--- a/Gemfile+++ b/Gemfile@@ -18,7 +18,7 @@ else# this allows us to include the bits of rails we use without pieces we do not.## To issue a rails update bump the version number here- rails_version = '7.0.2.4'+ rails_version = '7.0.3'gem 'actionmailer', rails_versiongem 'actionpack', rails_versiongem 'actionview', rails_versiondiff --git a/Gemfile.lock b/Gemfile.lockindex 6000bf36cb7..a2c2160fe3a 100644--- a/Gemfile.lock+++ b/Gemfile.lock@@ -1,25 +1,25 @@GEMremote: https://rubygems.org/specs:- actionmailer (7.0.2.4)- actionpack (= 7.0.2.4)- actionview (= 7.0.2.4)- activejob (= 7.0.2.4)- activesupport (= 7.0.2.4)+ actionmailer (7.0.3)+ actionpack (= 7.0.3)+ actionview (= 7.0.3)+ activejob (= 7.0.3)+ activesupport (= 7.0.3)mail (~> 2.5, >= 2.5.4)net-imapnet-popnet-smtprails-dom-testing (~> 2.0)- actionpack (7.0.2.4)- actionview (= 7.0.2.4)- activesupport (= 7.0.2.4)+ actionpack (7.0.3)+ actionview (= 7.0.3)+ activesupport (= 7.0.3)rack (~> 2.0, >= 2.2.0)rack-test (>= 0.6.3)rails-dom-testing (~> 2.0)rails-html-sanitizer (~> 1.0, >= 1.2.0)- actionview (7.0.2.4)- activesupport (= 7.0.2.4)+ actionview (7.0.3)+ activesupport (= 7.0.3)builder (~> 3.1)erubi (~> 1.4)rails-dom-testing (~> 2.0)@@ -28,15 +28,15 @@ GEMactionview (>= 6.0.a)active_model_serializers (0.8.4)activemodel (>= 3.0)- activejob (7.0.2.4)- activesupport (= 7.0.2.4)+ activejob (7.0.3)+ activesupport (= 7.0.3)globalid (>= 0.3.6)- activemodel (7.0.2.4)- activesupport (= 7.0.2.4)- activerecord (7.0.2.4)- activemodel (= 7.0.2.4)- activesupport (= 7.0.2.4)- activesupport (7.0.2.4)+ activemodel (7.0.3)+ activesupport (= 7.0.3)+ activerecord (7.0.3)+ activemodel (= 7.0.3)+ activesupport (= 7.0.3)+ activesupport (7.0.3)concurrent-ruby (~> 1.0, >= 1.0.2)i18n (>= 1.6, < 2)minitest (>= 5.1)@@ -349,9 +349,9 @@ GEMrails_multisite (4.0.1)activerecord (> 5.0, < 7.1)railties (> 5.0, < 7.1)- railties (7.0.2.4)- actionpack (= 7.0.2.4)- activesupport (= 7.0.2.4)+ railties (7.0.3)+ actionpack (= 7.0.3)+ activesupport (= 7.0.3)method_sourcerake (>= 12.2)thor (~> 1.0)@@ -509,14 +509,14 @@ PLATFORMSx86_64-linuxDEPENDENCIES- actionmailer (= 7.0.2.4)- actionpack (= 7.0.2.4)- actionview (= 7.0.2.4)+ actionmailer (= 7.0.3)+ actionpack (= 7.0.3)+ actionview (= 7.0.3)actionview_precompileractive_model_serializers (~> 0.8.3)- activemodel (= 7.0.2.4)- activerecord (= 7.0.2.4)- activesupport (= 7.0.2.4)+ activemodel (= 7.0.3)+ activerecord (= 7.0.3)+ activesupport (= 7.0.3)addressableannotateaws-sdk-s3@@ -596,7 +596,7 @@ DEPENDENCIESrack-protectionrails_failoverrails_multisite- railties (= 7.0.2.4)+ railties (= 7.0.3)rakerb-fseventrbtracediff --git a/lib/freedom_patches/ar_references_fix.rb b/lib/freedom_patches/ar_references_fix.rbdeleted file mode 100644index ba9db28010c..00000000000--- a/lib/freedom_patches/ar_references_fix.rb+++ /dev/null@@ -1,50 +0,0 @@-# frozen_string_literal: true--# This patch is a backport of https://github.com/rails/rails/pull/42350-# It fixes a bug introduced by Rails which affects reference columns marking-# them as integer instead of bigint.-#-# This should be deleted when version 7.0.3 is released.-module FreedomPatches- module ArReferencesFix- module SchemaDefinition- def index_options(table_name)- index_options = as_options(index)-- # legacy reference index names are used on versions 6.0 and earlier- return index_options if options[:_uses_legacy_reference_index_name]-- index_options[:name] ||= polymorphic_index_name(table_name) if polymorphic- index_options- end-- ActiveRecord::ConnectionAdapters::ReferenceDefinition.prepend(self)- end- end-end--class ActiveRecord::Migration::Compatibility::V6_0- module TableDefinition- def references(*args, **options)- options[:_uses_legacy_reference_index_name] = true- super- end- alias :belongs_to :references- end-- def add_reference(table_name, ref_name, **options)- if connection.adapter_name == "SQLite"- options[:type] = :integer- end- options[:_uses_legacy_reference_index_name] = true- super- end- alias :add_belongs_to :add_reference-- def compatible_table_definition(t)- class << t- prepend TableDefinition- end- super- end-end