Skip to content

Upgrading rails 6 to 7

Breaking6.1.7.10 → 7.2.4Breaking174Security44Platform1Deprecated70New459Changed354Fixed589Other7

BreakingUpgrade verdict

171 breaking changes and a platform requirement change and 44 security fixes.

  • Removes the old way of calling deprecation helpers without a deprecator argument.
  • Removes two deprecated event methods; code using them will break.
  • Removes the deprecated behavior of delegating deprecation calls to an instance.
  • Removes a deprecated method for cloning an empty safe buffer.
Top 5 of 286 that need code or config changes

rails publishes an official migration guide for version 7. It covers more than the release notes do.

Upgrading from Rails 6.1 to Rails 7.0 ↗

Ruby requirement changed in 7.2.0.beta1: >= 2.5.0 → >= 3.1.0.

Breaking171
Removes deprecated support to call deprecation methods without passing a deprecator.
deprecatedeprecate_constantActiveSupport::Deprecation::DeprecatedObjectProxy.newActiveSupport::Deprecation::DeprecatedInstanceVariableProxy.newActiveSupport::Deprecation::DeprecatedConstantProxy.newassert_deprecatedassert_not_deprecatedcollect_deprecations
Removes deprecated ActiveSupport::Notifications::Event#children and Event#parent_of?.
ActiveSupport::Notifications::Event#childrenActiveSupport::Notifications::Event#parent_of?
Removes deprecated ActiveSupport::Deprecation delegation to instance.
ActiveSupport::Deprecation
Removes deprecated SafeBuffer#clone_empty.
SafeBuffer#clone_empty
Removes deprecated #to_default_s from Array, Date, DateTime and Time.
#to_default_sArrayDateDateTimeTime
Removes deprecated support to passing Dalli::Client instances to MemCacheStore.
Dalli::ClientMemCacheStore
Removes deprecated config.active_support.use_rfc4122_namespaced_uuids.
config.active_support.use_rfc4122_namespaced_uuids
Removes deprecated config.active_support.remove_deprecated_time_with_zone_name.
config.active_support.remove_deprecated_time_with_zone_name
Removes deprecated config.active_support.disable_to_s_conversion.
config.active_support.disable_to_s_conversion
Removes deprecated support to bold log text with positional boolean in ActiveSupport::LogSubscriber#color.
ActiveSupport::LogSubscriber#color
Removes deprecated constants ActiveSupport::LogSubscriber::CLEAR and ActiveSupport::LogSubscriber::BOLD.
ActiveSupport::LogSubscriber::CLEARActiveSupport::LogSubscriber::BOLD
Removes deprecated support for config.active_support.cache_format_version = 6.1.
config.active_support.cache_format_version
Removes deprecated :pool_size and :pool_timeout options for the cache storage.
:pool_size:pool_timeout
Removes deprecated behavior that rolled back a transaction block when exited using return, break or throw.
returnbreakthrow
Removes deprecated support to pass rewhere to ActiveRecord::Relation#merge.
ActiveRecord::Relation#mergerewhere
Removes deprecated support to pass deferrable: true to add_foreign_key.
add_foreign_keydeferrable
Removes deprecated support to quote ActiveSupport::Duration.
ActiveSupport::Duration
Removes deprecated #quote_bound_value.
#quote_bound_value
Removes deprecated ActiveRecord::ConnectionAdapters::ConnectionPool#connection_klass.
ActiveRecord::ConnectionAdapters::ConnectionPool#connection_klass
Removes deprecated support for applying connection pool list and clear/flush methods to current role pools without a role argument.
#connection_pool_list#active_connections?#clear_active_connections!#clear_reloadable_connections!#clear_all_connections!#flush_idle_connections!
Removes deprecated #all_connection_pools.
#all_connection_pools
Removes deprecated ActiveRecord::ConnectionAdapters::SchemaCache#data_sources.
ActiveRecord::ConnectionAdapters::SchemaCache#data_sources
Removes deprecated ActiveRecord::ConnectionAdapters::SchemaCache.load_from.
ActiveRecord::ConnectionAdapters::SchemaCache.load_from
Removes deprecated #all_foreign_keys_valid? from database adapters.
#all_foreign_keys_valid?
Removes deprecated support for passing coder and class as the second argument to serialize.
serialize
Removes deprecated support for ActiveRecord::Base#read_attribute(:id) returning the custom primary key value.
ActiveRecord::Base#read_attribute
Removes deprecated TestFixtures.fixture_path.
TestFixtures.fixture_path
Removes deprecated behavior of referring to a singular association by its plural name.
Removes deprecated support for passing SchemaMigration and InternalMetadata classes to ActiveRecord::MigrationContext.
SchemaMigrationInternalMetadataActiveRecord::MigrationContext
Removes deprecated ActiveRecord::Migration.check_pending! method.
ActiveRecord::Migration.check_pending!
Removes deprecated ActiveRecord::LogSubscriber.runtime method.
ActiveRecord::LogSubscriber.runtimeActiveRecord::LogSubscriber.runtime=
Removes deprecated ActiveRecord::LogSubscriber.reset_runtime method.
ActiveRecord::LogSubscriber.reset_runtime
Removes deprecated support for defining explain in the connection adapter with 2 arguments.
explain
Removes deprecated ActiveRecord::ActiveJobRequiredError.
ActiveRecord::ActiveJobRequiredError
Removes deprecated ActiveRecord::Base.clear_active_connections!.
ActiveRecord::Base.clear_active_connections!
Removes deprecated ActiveRecord::Base.clear_reloadable_connections!.
ActiveRecord::Base.clear_reloadable_connections!
Removes deprecated ActiveRecord::Base.clear_all_connections!.
ActiveRecord::Base.clear_all_connections!
Removes deprecated ActiveRecord::Base.flush_idle_connections!.
ActiveRecord::Base.flush_idle_connections!
Removes deprecated name argument from ActiveRecord::Base.remove_connection.
ActiveRecord::Base.remove_connection
Removes deprecated support for calling alias_attribute with non-existent attribute names.
alias_attribute
Removes deprecated Rails.application.config.active_record.suppress_multiple_database_warning.
Rails.application.config.active_record.suppress_multiple_database_warning
Removes deprecated support for setting Rails.application.config.action_dispatch.show_exceptions to true and false.
Rails.application.config.action_dispatch.show_exceptions
Removes deprecated speaker, vibrate, and vr permissions policy directives.
speakervibratevr
Removes deprecated Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type.
Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type
Removes deprecated comparison between ActionController::Parameters and Hash.
ActionController::ParametersHash
Removes deprecated constant AbstractController::Helpers::MissingHelperError.
AbstractController::Helpers::MissingHelperError
Removes deprecated constant ActionDispatch::IllegalStateError.
ActionDispatch::IllegalStateError
Removes deprecated :exponentially_longer value for :wait in retry_on.
retry_on:wait:exponentially_longer
Removes deprecated support for setting numeric values to the scheduled_at attribute.
scheduled_at
Removes deprecated primitive serializer for BigDecimal arguments.
BigDecimal
Removes deprecated params via :args for assert_enqueued_email_with.
assert_enqueued_email_with:args
Removes deprecated config.action_mailer.preview_path.
config.action_mailer.preview_path
Removes deprecated config.active_storage.silence_invalid_content_types_warning.
config.active_storage.silence_invalid_content_types_warning
Removes deprecated config.active_storage.replace_on_assign_to_many.
config.active_storage.replace_on_assign_to_many
Removes oracle, sqlserver and JRuby specific database adapters from rails new and rails db:system:change; supported options are sqlite3, mysql, postgresql and trilogy.
rails newrails db:system:changesqlite3mysqlpostgresqltrilogy
Removes the deprecated find_cmd_and_exec console helper.
find_cmd_and_exec
Removes deprecated Rails.config.enable_dependency_loading.
Rails.config.enable_dependency_loading
Removes deprecated Rails.application.secrets.
Rails.application.secrets
Removes deprecated support for the pre-Ruby 2.4 behavior of to_time returning a Time with local timezone.
to_time
Renames ActionView::TestCase::Behavior::Content to ActionView::TestCase::Behavior::RenderedViewContent, which now inherits from String.
ActionView::TestCase::Behavior::ContentActionView::TestCase::Behavior::RenderedViewContent
Renames ActionView::TestCase::Behavior::Content to RenderedViewContent, which now inherits from String and is marked nodoc.
ActionView::TestCase::Behavior::ContentActionView::TestCase::Behavior::RenderedViewContent
Removes deprecated support for generating incorrect RFC 4122 UUIDs when the namespace ID is not a Digest::UUID constant.
Digest::UUID
Removes implicit conversion of objects into String by ActiveSupport::SafeBuffer.
ActiveSupport::SafeBuffer
Removes the deprecated active_support/core_ext/range/include_time_with_zone file.
active_support/core_ext/range/include_time_with_zone
Removes the deprecated override of ActiveSupport::TimeWithZone.name.
ActiveSupport::TimeWithZone.name
Removes the deprecated option to pass a format to #to_s in Array, Range, Date, DateTime, Time, BigDecimal, Float and Integer.
Array#to_sRange#to_sDate#to_sDateTime#to_sTime#to_sBigDecimal#to_sFloat#to_sInteger#to_s
Removes deprecated ActiveSupport::PerThreadRegistry.
ActiveSupport::PerThreadRegistry
Removes the deprecated override of Enumerable#sum.
Enumerable#sum
Renames add_unique_key and remove_unique_key to add_unique_constraint and remove_unique_constraint.
add_unique_keyremove_unique_keyadd_unique_constraintremove_unique_constraint
Removes deprecated Tasks::DatabaseTasks.schema_file_type.
Tasks::DatabaseTasks.schema_file_type
Removes deprecated config.active_record.partial_writes.
config.active_record.partial_writes
Removes deprecated ActiveRecord::Base config accessors.
ActiveRecord::Base
Removes the :include_replicas argument from configs_for; use :include_hidden instead.
configs_for:include_replicas:include_hidden
Moves ActiveRecord::InternalMetadata to an independent object no longer inheriting from ActiveRecord::Base.
ActiveRecord::InternalMetadataActiveRecord::BaseActiveRecord::Base.connection.schema_migrationActiveRecord::SchemaMigration
Removes ActiveRecord.legacy_connection_handling.
ActiveRecord.legacy_connection_handling
Removes the --no-comments flag in PostgreSQL structure dumps; set structure_dump_flags instead.
--no-commentsActiveRecord::Tasks::DatabaseTasks.structure_dump_flags
Renames add_unique_key and remove_unique_key to add_unique_constraint and remove_unique_constraint.
add_unique_keyremove_unique_keyadd_unique_constraintremove_unique_constraint
Removes deprecated Tasks::DatabaseTasks.schema_file_type.
Tasks::DatabaseTasks.schema_file_type
Removes deprecated config.active_record.partial_writes.
config.active_record.partial_writes
Removes deprecated ActiveRecord::Base config accessors.
ActiveRecord::Base
Removes the :include_replicas argument from configs_for in favor of :include_hidden.
configs_forinclude_replicasinclude_hidden
Moves ActiveRecord::InternalMetadata to an independent object that no longer inherits from ActiveRecord::Base.
ActiveRecord::InternalMetadataActiveRecord::BaseActiveRecord::Base.connection.schema_migration
ActiveRecord::SchemaMigration no longer inherits from ActiveRecord::Base and must be instantiated with a connection.
ActiveRecord::SchemaMigrationActiveRecord::BaseActiveRecord::Base.connection.schema_migration
Changes QueryMethods#in_order_of to drop records not listed in values, matching the Enumerable version.
QueryMethods#in_order_of
Removes the deprecated MAILGUN_INGRESS_API_KEY environment variable.
MAILGUN_INGRESS_API_KEY
Removes the deprecated Rails.application.credentials.action_mailbox.mailgun_api_key credential.
Rails.application.credentials.action_mailbox.mailgun_api_key
Removes deprecated ActionMailer::DeliveryJob and ActionMailer::Parameterized::DeliveryJob in favor of ActionMailer::MailDeliveryJob.
ActionMailer::DeliveryJobActionMailer::Parameterized::DeliveryJobActionMailer::MailDeliveryJob
Removes deprecated Rails.config.action_view.raise_on_missing_translations.
Rails.config.action_view.raise_on_missing_translations
Removes deprecated support for passing a path to fixture_file_upload relative to fixture_path.
fixture_file_uploadfixture_path
Removes deprecated ActionDispatch::SystemTestCase#host!.
ActionDispatch::SystemTestCase#host!
Removes deprecated Rails.config.action_dispatch.hosts_response_app.
Rails.config.action_dispatch.hosts_response_app
Removes deprecated ActionDispatch::Response.return_only_media_type_on_content_type.
ActionDispatch::Response.return_only_media_type_on_content_type
Drops support for the SERVER_ADDR header.
SERVER_ADDR
Removes the legacy default media=screen from stylesheet_link_tag.
stylesheet_link_tag
Removes the deprecated :return_false_on_aborted_enqueue option.
:return_false_on_aborted_enqueue
Removes deprecated behavior that did not halt after_enqueue/after_perform callbacks when a previous callback was halted with throw :abort.
after_enqueueafter_performthrow :abort
Removes support for Marshal loading the Rails 5.x ActiveModel::AttributeSet format.
ActiveModel::AttributeSet
Removes support for Marshal and YAML loading the Rails 5.x error format.
Removes deprecated support for using []= in ActiveModel::Errors#messages.
ActiveModel::Errors#messages[]=
Removes deprecated support for delete on ActiveModel::Errors#messages.
ActiveModel::Errors#messagesdelete
Removes deprecated support for clear on ActiveModel::Errors#messages.
ActiveModel::Errors#messagesclear
Removes deprecated support for concatenating errors to ActiveModel::Errors#messages.
ActiveModel::Errors#messages
Removes deprecated ActiveModel::Errors#to_xml.
ActiveModel::Errors#to_xml
Removes deprecated ActiveModel::Errors#keys.
ActiveModel::Errors#keys
Removes deprecated ActiveModel::Errors#values.
ActiveModel::Errors#values
Removes deprecated ActiveModel::Errors#slice!.
ActiveModel::Errors#slice!
Removes deprecated ActiveModel::Errors#to_h.
ActiveModel::Errors#to_h
Removes deprecated enumeration of ActiveModel::Errors instances as a Hash.
ActiveModel::Errors
Removes deprecated ActiveRecord::DatabaseConfigurations::DatabaseConfig#spec_name.
ActiveRecord::DatabaseConfigurations::DatabaseConfig#spec_name
Removes deprecated ActiveRecord::Connection#in_clause_length.
ActiveRecord::Connection#in_clause_length
Removes deprecated ActiveRecord::Connection#allowed_index_name_length.
ActiveRecord::Connection#allowed_index_name_length
Removes deprecated ActiveRecord::Base#remove_connection.
ActiveRecord::Base#remove_connection
Removes deprecated ActiveRecord::Result#map! and ActiveRecord::Result#collect!.
ActiveRecord::Result#map!ActiveRecord::Result#collect!
Removes deprecated ActiveRecord::Base.configurations.to_h.
ActiveRecord::Base.configurations.to_h
Removes deprecated ActiveRecord::Base.configurations.default_hash.
ActiveRecord::Base.configurations.default_hash
Removes deprecated ActiveRecord::Base.arel_attribute.
ActiveRecord::Base.arel_attribute
Removes deprecated ActiveRecord::Base.connection_config.
ActiveRecord::Base.connection_config
Removes deprecated Tasks::DatabaseTasks.spec.
Tasks::DatabaseTasks.spec
Removes deprecated Tasks::DatabaseTasks.current_config.
Tasks::DatabaseTasks.current_config
Removes deprecated Tasks::DatabaseTasks.dump_filename.
Tasks::DatabaseTasks.dump_filename
Removes deprecated Tasks::DatabaseTasks.schema_file.
Tasks::DatabaseTasks.schema_file
Removes deprecated environment and name arguments from Tasks::DatabaseTasks.schema_up_to_date?.
Tasks::DatabaseTasks.schema_up_to_date?
Removes deprecated support for Model.reorder(nil).first to search using non-deterministic order.
Model.reorder(nil).first
Removes the deprecated DatabaseConfig#config method.
DatabaseConfig#config
Removes deprecated support to pass a column to type_cast.
type_cast
Removes deprecated support to type cast ActiveRecord::Base objects to database values.
ActiveRecord::Base
Removes deprecated support to quote ActiveRecord::Base objects.
ActiveRecord::Base
Removes deprecated support to resolve connections using "primary" as the connection specification name.
Removes deprecated support to YAML load ActiveRecord::Base instances in the Rails 4.2 and 4.1 formats.
ActiveRecord::Base
Removes the deprecated :spec_name option in the configs_for method.
configs_for:spec_name
Removes the deprecated ActiveRecord::Base.allow_unsafe_raw_sql setting.
ActiveRecord::Base.allow_unsafe_raw_sql
ActiveRecord::Base.logger becomes a class_attribute, so it is no longer accessible via @@logger and subclass assignment no longer affects the parent.
ActiveRecord::Base.logger@@loggerlogger =
Removes the deprecated database kwarg from connected_to.
connected_to
Removes deprecated build_after_upload, create_after_upload! and service_url methods.
build_after_uploadcreate_after_upload!create_and_upload!service_urlurl
Removes the deprecated ActiveSupport::Multibyte::Unicode.default_normalization_form.
ActiveSupport::Multibyte::Unicode.default_normalization_form
Removes deprecated support for using Range#include? to check inclusion of a value in a date time range.
Range#include?
Removes the deprecated URI.parser.
URI.parser
Removes the deprecated config.active_support.use_sha1_digests.
config.active_support.use_sha1_digests
Removes the classic autoloader: ActiveSupport::Dependencies no longer installs a const_missing hook.
ActiveSupport::Dependenciesconst_missing
Deletes the private API of ActiveSupport::Dependencies, including hook!, unhook!, depend_on, require_or_load and mechanism.
ActiveSupport::Dependencieshook!unhook!depend_onrequire_or_loadmechanism
Removes the rescue block from ActiveSupport::Cache::RedisCacheStore#handle_exception so errors raised by a custom error_handler are no longer swallowed.
ActiveSupport::Cache::RedisCacheStore#handle_exceptionerror_handlerredis_cache_store
Freezes ActiveSupport::Duration#parts and removes its writer methods, since durations are meant to be immutable value objects.
ActiveSupport::Duration#parts
Removes deprecated config in dbconsole.
configdbconsole
Deletes the config.autoloader= setter; zeitwerk is now the only autoloading mode.
config.autoloader=zeitwerk
Prevents glob injection in DiskService#delete_prefixed by escaping glob metacharacters, breaking code that relied on glob expansion.
DiskService#delete_prefixedDir.glob
Removes deprecated Rails::Generators::Testing::Behaviour.
Rails::Generators::Testing::Behaviour
Raises an error when foreign_key: is passed as an array in associations.
foreign_key:
Raises ActiveSupport::MessageEncryptor::InvalidMessage from decrypt_and_verify regardless of cipher.
ActiveSupport::MessageEncryptor#decrypt_and_verifyActiveSupport::MessageEncryptor::InvalidMessageActiveSupport::MessageVerifier::InvalidSignature
Raises ArgumentError when accepts_nested_attributes_for is declared more than once for an association in the same class.
accepts_nested_attributes_forArgumentError
ActiveRecord::Base.serialize now takes two distinct keyword arguments instead of one positional argument.
ActiveRecord::Base.serialize
ActiveRecord::Base#signed_id now raises when called on a new record instead of returning an unusable ID.
ActiveRecord::Base#signed_id
Raises ActiveRecord::ReadonlyAttributeError on assignment to readonly attributes, configurable via raise_on_assign_to_attr_readonly.
attr_readonlyActiveRecord::ReadonlyAttributeErrorconfig.active_record.raise_on_assign_to_attr_readonlyconfig.load_defaults
Invalid options passed to migration methods like create_table and add_column now raise an error instead of being silently ignored.
create_tableadd_column
change_column_null now raises when given a non-boolean argument instead of treating it as truthy.
change_column_null
MessageEncryptor#decrypt_and_verify now raises InvalidMessage for all ciphers, not InvalidSignature for non-AEAD ciphers.
ActiveSupport::MessageEncryptor#decrypt_and_verifyActiveSupport::MessageEncryptor::InvalidMessageActiveSupport::MessageVerifier::InvalidSignature
ActiveSupport::Deprecation instances now use their own disallowed_warnings; global methods are deprecated.
ActiveSupport::DeprecationActiveSupport::Deprecation.disallowed_warningsActiveSupport::Deprecation.warn
Raises ArgumentError when accepts_nested_attributes_for is declared more than once for an association in the same class.
accepts_nested_attributes_for
Changes ActiveRecord::Base.serialize to accept distinct coder: and type: keyword arguments instead of one positional argument.
ActiveRecord::Base.serialize
ActiveRecord::Base#signed_id now raises if called on a new record instead of returning an unusable ID based on id = nil.
ActiveRecord::Base#signed_id
Moves ActiveRecord::SchemaMigration to an independent object.
ActiveRecord::SchemaMigration
Reverts the ability to pass a service_name param to DirectUploadsController, introduced in 7.0.0.
DirectUploadsControllerservice_name
Stops transpiling the UMD package generated as actioncable.js and drops IE11 testing that relied on it.
actioncable.js
Writing into a disabled session now raises an error instead of silently failing.
ActionDispatch::Request#content_type now returns the Content-Type header as-is including charset; use media_type for just the MIME type.
ActionDispatch::Request#content_typeActionDispatch::Request#media_type
FormBuilder#button now transforms formmethod attributes into _method form data for varied same-form actions.
ActionView::Helpers::FormBuilder#buttonformmethod_method
UrlHelper#button_to now always renders a button element, whether content is passed as an argument or a block.
ActionView::Helpers::UrlHelper#button_to
Merging conditions on the same column now consistently replaces the earlier condition with the latter.
mergerewhere
Removes deprecated rake tasks db:schema:load_if_ruby, db:structure:dump, db:structure:load, db:structure:load_if_sql, db:structure:dump:#{name}, db:structure:load:#{name}…
db:schema:load_if_rubydb:structure:dumpdb:structure:loaddb:structure:load_if_sqldb:structure:dump:#{name}db:structure:load:#{name}db:test:load_structuredb:test:load_structure:#{name}
Deletes private internal classes of ActiveSupport::Dependencies such as Reference and Blamable.
ActiveSupport::Dependencies::ReferenceActiveSupport::Dependencies::Blamable
Disallows autoloading reloadable classes or modules during initialization unless wrapped in a to_prepare block.
to_prepare
Fixture configurations (_fixture) are now strictly validated and raise an error on unknown keys instead of silently ignoring them.
_fixture
Security44
Disables libvips unfuzzed image loaders and savers via Vips.block_untrusted(true) at boot, raising Vips::Error for affected transformations.
Vips.block_untrusted(true)Vips::Errorconfig.active_storage.variable_content_types:mini_magick
Rejects scientific notation in NumberConverter.
NumberConverter
Fixes SafeBuffer#% to preserve unsafe status.
SafeBuffer#%
Improves performance of NumberToDelimitedConverter.
NumberToDelimitedConverter
Skips blank attribute names in tag helpers to avoid generating invalid HTML.
Filters user supplied metadata in DirectUploadController.
DirectUploadController
Adds a configurable maximum streaming chunk size, defaulting to 100mb for blob byte ranges.
Limits range requests to a single range.
Prevents path traversal in DiskService; path_for raises InvalidKeyError for dot segments or paths outside the storage root.
DiskServiceDiskService#path_forInvalidKeyErrorDiskController
Calls inspect on ids in RecordNotFound error messages.
RecordNotFound
Removes dangerous transformations in Active Storage.
Sanitizes ActionText HTML ContentAttachment in the Trix edit view.
ActionText::ContentAttachment
Fixes ReDoS in Accept header parsing.
Stops ActiveSupport::KeyGenerator#inspect from displaying the secret.
ActiveSupport::KeyGenerator#inspectActiveSupport::KeyGenerator
Stops ActiveSupport::MessageEncryptor#inspect from displaying the secret.
ActiveSupport::MessageEncryptor#inspectActiveSupport::MessageEncryptor
Stops EncryptedConfiguration#inspect from displaying configuration contents and key file contents.
EncryptedConfiguration#inspectRails.application.credentials
Stops showing secrets in ActiveRecord::Encryption::Cipher::Aes256Gcm#inspect output.
ActiveRecord::Encryption::Cipher::Aes256Gcm#inspect
Stops ActiveRecord::Encryption::Cipher::Aes256Gcm#inspect from showing the secret.
ActiveRecord::Encryption::Cipher::Aes256Gcm#inspect
Adds validation to content security policies to disallow spaces and semicolons.
Avoids regex backtracking in HTTP Token authentication.
Avoids regex backtracking in query parameter filtering.
Avoids regex backtracking in the block_format helper.
block_format
Avoids backtracking in plain_text_for_blockquote_node.
plain_text_for_blockquote_node
Includes the HTTP Permissions-Policy header on non-HTML content types.
Upgrades Trix to 1.3.2 to fix CVE-2024-34341.
Trix
Fixes a possible XSS vulnerability with the translate method in controllers (CVE-2024-26143).
translateModerate · CVSS 6.1
Uses a temporary file for storing unencrypted files while editing, addressing CVE-2023-38037.
Raises an exception if illegal characters are provided to redirect_to.
redirect_to
Implements SafeBuffer#bytesplice to address CVE-2023-28120.
SafeBuffer#bytesplice
Ignores certain data-* attributes in rails-ujs when the element is contenteditable, addressing CVE-2023-23913.
rails-ujs
Avoids regex backtracking in Inflector.underscore.
Inflector.underscore
Makes sanitize_as_sql_comment more strict by escaping comment delimiters and stripping one surrounding comment.
sanitize_as_sql_commentannotate
Adds an integer width check to PostgreSQL::Quoting, configurable via ActiveRecord::Base.raise_int_wider_than_64bit (default true).
PostgreSQL::QuotingActiveRecord::Base.raise_int_wider_than_64bit
Fixes a security issue in _url_host_allowed? by disallowing certain strings to prevent redirects to malicious sites.
_url_host_allowed?
Avoids regex backtracking when parsing the If-None-Match header.
If-None-Match
Uses string#split instead of regex for domain parts.
string#split
Changes ActiveRecord::Coders::YAMLColumn default to safe_load, addressing CVE-2022-32224.
ActiveRecord::Coders::YAMLColumnconfig.active_storage.use_yaml_unsafe_loadconfig.active_record.yaml_column_permitted_classes
Adds XSS protections in ActionView::Helpers and ERB::Util, including new ERB::Util.xml_name_escape for tag and attribute names.
ActionView::HelpersERB::UtilERB::Util.xml_name_escape
Escapes dangerous characters in tag helper tag and attribute names per XML spec, and renames the :escape_attributes option to :escape.
:escape_attributes:escape
Adds image transformation validation via a configurable allow-list for Active Storage variants, plus a deny-list for arguments.
Variant
Fixes a case where the middleware is not told the response body is fully closed, so request state is not fully reset before the next request.
Uses a static error message when raising ActionDispatch::Http::Parameters::ParseError to avoid logging malformed JSON request bodies.
ActionDispatch::Http::Parameters::ParseError
Casts numbers and booleans bind parameters to string in the MySQL adapter to prevent implicit cast vulnerabilities.
User.where
Fixes X_FORWARDED_HOST protection in Action Pack.
X_FORWARDED_HOST
Platform1
Requires libvips 8.13 or later and ruby-vips 2.2.1 or later when ruby-vips is installed, raising RuntimeError at boot otherwise.
libvipsruby-vipsRuntimeError
Deprecated70
Deprecates ActiveSupport::ProxyObject in favor of Ruby's built-in BasicObject.
ActiveSupport::ProxyObjectBasicObject
Deprecates ActiveRecord::ImmutableRelation in favor of ActiveRecord::UnmodifiableRelation.
ActiveRecord::ImmutableRelationActiveRecord::UnmodifiableRelation
Deprecates the association option query_constraints in favor of foreign_key.
query_constraintsforeign_key
Deprecates ActiveRecord::Base.connection in favor of .lease_connection as a soft deprecation.
ActiveRecord::Base.connectionActiveRecord::Base.lease_connection
Deprecates ActiveRecord::ConnectionAdapters::ConnectionPool#connection in favor of lease_connection.
ActiveRecord::ConnectionAdapters::ConnectionPool#connectionActiveRecord::ConnectionAdapters::ConnectionPool#lease_connection
Deprecates Rails.application.config.active_record.commit_transaction_on_non_local_return.
Rails.application.config.active_record.commit_transaction_on_non_local_return
Deprecates Rails.application.config.active_record.allow_deprecated_singular_associations_name.
Rails.application.config.active_record.allow_deprecated_singular_associations_name
Deprecates ENV["SCHEMA_CACHE"] in favor of schema_cache_path in the database configuration.
ENV["SCHEMA_CACHE"]schema_cache_path
Deprecates config.active_record.warn_on_records_fetched_greater_than since sql.active_record now includes :row_count.
config.active_record.warn_on_records_fetched_greater_thansql.active_recordrow_count
Deprecates defining an enum with keyword arguments.
enum
Deprecates passing strings to ActiveRecord::Tasks::DatabaseTasks.cache_dump_filename.
ActiveRecord::Tasks::DatabaseTasks.cache_dump_filenameActiveRecord::DatabaseConfigurations::DatabaseConfig
Deprecates passing nil as the value for the model: argument to form_with.
form_withmodel:
Deprecates passing content to void elements when using tag.br type tag builders.
tag.br
Deprecates Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality.
Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality
Deprecates Rails.application.config.active_job.use_big_decimal_serialize.
Rails.application.config.active_job.use_big_decimal_serialize
Deprecates config.active_support.to_time_preserves_timezone.
config.active_support.to_time_preserves_timezone
Deprecates DateAndTime::Compatibility.preserve_timezone.
DateAndTime::Compatibility.preserve_timezone
Deprecates SafeBuffer#clone_empty, which has not been used internally since Rails 4.2.0.
SafeBuffer#clone_empty
Deprecates usage of the singleton ActiveSupport::Deprecation, including Module.deprecate and related proxies and test assertions without a deprecator argument.
ActiveSupport::DeprecationActiveSupport::Deprecation.warnModule.deprecatedeprecate_constantDeprecatedObjectProxyDeprecatedInstanceVariableProxyDeprecatedConstantProxyActiveSupport::Deprecation.silence
Deprecates config.active_support.use_rfc4122_namespaced_uuids.
config.active_support.use_rfc4122_namespaced_uuids
Deprecates config.active_support.remove_deprecated_time_with_zone_name.
config.active_support.remove_deprecated_time_with_zone_name
Deprecates config.active_support.disable_to_s_conversion.
config.active_support.disable_to_s_conversion
Deprecates initializing ActiveSupport::Cache::MemCacheStore with an instance of Dalli::Client.
ActiveSupport::Cache::MemCacheStoreDalli::Client
Deprecates the :pool_size and :pool_timeout options for cache store connection pooling in favor of :pool.
:pool_size:pool_timeoutpool
Deprecates preserving the pre-Ruby 2.4 behavior of to_time; warning appears only when the setting is false.
to_time
Deprecates Notification::Event's #children and #parent_of? methods.
Notification::Event#children#parent_of?
Deprecates the rewhere argument on merge, to be removed in Rails 7.2.
mergerewhere
Deprecates read_attribute(:id) returning the primary key when the primary key is not :id.
read_attribute(:id)#id
Deprecates the name argument on #remove_connection without replacement.
#remove_connection
Deprecates check_pending! in favor of check_all_pending!, which checks all database configurations in the environment.
check_pending!check_all_pending!
Deprecates the deferrable: true option of add_foreign_key in favor of deferrable: :immediate, to be removed in Rails 7.2.
add_foreign_keydeferrable
Deprecates delegation from Base to connection_handler for clear_all_connections!, clear_active_connections!, clear_reloadable_connections! and flush_idle_connections!.
Base.clear_all_connections!Base.clear_active_connections!Base.clear_reloadable_connections!Base.flush_idle_connections!connection_handler
Deprecates config.active_record.suppress_multiple_database_warning.
config.active_record.suppress_multiple_database_warning
Deprecates quoting ActiveSupport::Duration as an integer in SQL string templates.
ActiveSupport::Durationto_iiso8601
Deprecates all_connection_pools and makes connection_pool_list require an explicit role or :all.
all_connection_poolsconnection_pool_list
Adds a configurable deprecation warning for using plural names of singular associations in where, with an opt-in faster behavior.
whereconfig.active_record.allow_deprecated_singular_associations_name
Sets scheduled_at as a Time object and deprecates assigning numeric/epoch values; enqueued_at deserializes as Time.
scheduled_atscheduled_at=enqueued_at
Deprecates SafeBuffer#clone_empty, which has not been used internally since Rails 4.2.0.
SafeBuffer#clone_empty
Deprecates usage of the singleton ActiveSupport::Deprecation and deprecator-less deprecation calls.
ActiveSupport::DeprecationActiveSupport::Deprecation.warnModule.deprecatedeprecate_constantDeprecatedObjectProxyDeprecatedInstanceVariableProxyDeprecatedConstantProxyActiveSupport::Deprecation.silence
Deprecates :pool_size and :pool_timeout options for cache store connection pooling.
pool_sizepool_timeoutpool
Deprecates the rewhere argument on #merge without replacement; it will be removed in Rails 7.2.
mergerewhere
Deprecates read_attribute(:id) returning the primary key when the primary key is not :id.
read_attributeid
Deprecates the name argument on #remove_connection without replacement; call it on the class that established the connection.
#remove_connection
Deprecates check_pending! in favor of check_all_pending!.
check_pending!check_all_pending!
Introduces TestFixtures#fixture_paths for multiple fixture paths and deprecates TestFixtures#fixture_path.
TestFixtures#fixture_pathsTestFixtures#fixture_path
Deprecates delegation from Base to connection_handler for connection clearing and flushing methods.
Base.clear_all_connections!Base.clear_active_connections!Base.clear_reloadable_connections!Base.flush_idle_connections!connection_handler
Deprecates quoting ActiveSupport::Duration as an integer in SQL string templates.
ActiveSupport::Durationto_iiso8601
Deprecates all_connection_pools and makes connection_pool_list require an explicit role or :all.
all_connection_poolsconnection_pool_list
Adds a deprecation warning for using plural names of singular associations in where, with an opt-in config.
config.active_record.allow_deprecated_singular_associations_name
Renames action_cable.js to actioncable.js to match other Rails frameworks, with a JS console deprecation notice.
action_cable.jsactioncable.js
Deprecates Rails.application.config.action_controller.urlsafe_csrf_tokens, which is now always enabled.
Rails.application.config.action_controller.urlsafe_csrf_tokens
Deprecates poltergeist and webkit driver registration for system testing, to be removed in Rails 7.1, and adds cuprite.
poltergeistwebkitcuprite
Deprecates assigning a single value to config.action_dispatch.trusted_proxies because RemoteIp middleware behaves inconsistently.
config.action_dispatch.trusted_proxiesRemoteIp
Deprecates assigning render locals to instance variables.
render
Deprecates Rails.config.active_job.skip_after_callbacks_if_terminated.
Rails.config.active_job.skip_after_callbacks_if_terminated
Deprecates Tasks::DatabaseTasks.schema_file_type.
Tasks::DatabaseTasks.schema_file_type
Deprecates partial_writes in favor of partial_inserts and partial_updates.
partial_writespartial_insertspartial_updates
Deprecates legacy_connection_handling.
legacy_connection_handling
Deprecates invalid default content types image/jpg, image/pjpeg, image/bmp and text/javascript, to be removed in Rails 7.1.
config.active_storage.silence_invalid_content_types_warning
Deprecates ActiveStorage::Current.host in favor of ActiveStorage::Current.url_options.
ActiveStorage::Current.hostActiveStorage::Current.url_options
Deprecates config.active_storage.replace_on_assign_to_many; future versions behave as when set to true.
config.active_storage.replace_on_assign_to_many
Deprecates usage of purge and purge_later from the association extension.
purgepurge_later
Deprecates passing a format to #to_s in favor of #to_formatted_s on Array, Range, Date, DateTime, Time, BigDecimal, Float and Integer.
#to_s#to_formatted_sArrayRangeDateDateTimeTimeBigDecimal
Deprecates ActiveSupport::DescendantsTracker.direct_descendants and #direct_descendants as it now mostly delegates to Class#descendants on Ruby 3.1.
ActiveSupport::DescendantsTrackerClass#descendantsActiveSupport::DescendantsTracker.direct_descendantsActiveSupport::DescendantsTracker#direct_descendants
Deprecates ActiveSupport::SafeBuffer's incorrect implicit conversion of objects into strings via #to_s instead of requiring #to_str.
ActiveSupport::SafeBuffer#to_str#to_sString#%
Deprecates ActiveSupport::TimeWithZone.name so that from Rails 7.1 it will use the default implementation.
ActiveSupport::TimeWithZone.name
Deprecates Rails custom Enumerable#sum and Array#sum in favor of Ruby's native implementation, which requires an initializer for non-numeric types.
Enumerable#sumArray#sum
Removes Rack::Runtime from the default middleware stack and deprecates referencing it in middleware operations without adding it back.
Rack::Runtime
Deprecates ActiveSupport::DescendantsTracker.direct_descendants and #direct_descendants as the tracker now mostly delegates to Class#descendants on Ruby 3.1.
ActiveSupport::DescendantsTrackerActiveSupport::DescendantsTracker.direct_descendantsActiveSupport::DescendantsTracker#direct_descendantsClass#descendants
Deprecates invalid default content types image/jpg, image/pjpeg, image/bmp and text/javascript, to be removed in Rails 7.1.
config.active_storage.silence_invalid_content_types_warning