Upgrading rails 6 to 7
Breaking6.1.7.10 → 7.2.4Breaking174Security44Platform1Deprecated70New459Changed354Fixed589Other7
SecurityDisables libvips unfuzzed image loaders and savers via Vips.block_untrusted(true) at boot, raising Vips::Error for affected transformations.GHSA-xr9x-r78c-5hrm ↗
BreakingUpgrade verdict
171 breaking changes and a platform requirement change and 44 security fixes.
In plain terms
- 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.
Must act 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.
What you must change
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_deprecationsRemoves 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::DeprecationRemoves deprecated
SafeBuffer#clone_empty.SafeBuffer#clone_emptyRemoves deprecated
#to_default_s from Array, Date, DateTime and Time.#to_default_sArrayDateDateTimeTimeRemoves deprecated support to passing
Dalli::Client instances to MemCacheStore.Dalli::ClientMemCacheStoreRemoves deprecated
config.active_support.use_rfc4122_namespaced_uuids.config.active_support.use_rfc4122_namespaced_uuidsRemoves deprecated
config.active_support.remove_deprecated_time_with_zone_name.config.active_support.remove_deprecated_time_with_zone_nameRemoves deprecated
config.active_support.disable_to_s_conversion.config.active_support.disable_to_s_conversionRemoves deprecated support to bold log text with positional boolean in
ActiveSupport::LogSubscriber#color.ActiveSupport::LogSubscriber#colorRemoves deprecated constants
ActiveSupport::LogSubscriber::CLEAR and ActiveSupport::LogSubscriber::BOLD.ActiveSupport::LogSubscriber::CLEARActiveSupport::LogSubscriber::BOLDRemoves deprecated support for
config.active_support.cache_format_version = 6.1.config.active_support.cache_format_versionRemoves deprecated
:pool_size and :pool_timeout options for the cache storage.:pool_size:pool_timeoutRemoves deprecated behavior that rolled back a transaction block when exited using return, break or throw.
returnbreakthrowRemoves deprecated support to pass rewhere to ActiveRecord::Relation#merge.
ActiveRecord::Relation#mergerewhereRemoves deprecated support to pass deferrable: true to add_foreign_key.
add_foreign_keydeferrableRemoves deprecated support to quote ActiveSupport::Duration.
ActiveSupport::DurationRemoves deprecated #quote_bound_value.
#quote_bound_valueRemoves deprecated ActiveRecord::ConnectionAdapters::ConnectionPool#connection_klass.
ActiveRecord::ConnectionAdapters::ConnectionPool#connection_klassRemoves 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_poolsRemoves deprecated ActiveRecord::ConnectionAdapters::SchemaCache#data_sources.
ActiveRecord::ConnectionAdapters::SchemaCache#data_sourcesRemoves deprecated ActiveRecord::ConnectionAdapters::SchemaCache.load_from.
ActiveRecord::ConnectionAdapters::SchemaCache.load_fromRemoves 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.
serializeRemoves deprecated support for ActiveRecord::Base#read_attribute(:id) returning the custom primary key value.
ActiveRecord::Base#read_attributeRemoves deprecated TestFixtures.fixture_path.
TestFixtures.fixture_pathRemoves 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::MigrationContextRemoves 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_runtimeRemoves deprecated support for defining explain in the connection adapter with 2 arguments.
explainRemoves deprecated ActiveRecord::ActiveJobRequiredError.
ActiveRecord::ActiveJobRequiredErrorRemoves 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_connectionRemoves deprecated support for calling alias_attribute with non-existent attribute names.
alias_attributeRemoves deprecated Rails.application.config.active_record.suppress_multiple_database_warning.
Rails.application.config.active_record.suppress_multiple_database_warningRemoves deprecated support for setting
Rails.application.config.action_dispatch.show_exceptions to true and false.Rails.application.config.action_dispatch.show_exceptionsRemoves deprecated
speaker, vibrate, and vr permissions policy directives.speakervibratevrRemoves 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_typeRemoves deprecated comparison between ActionController::Parameters and Hash.
ActionController::ParametersHashRemoves deprecated constant AbstractController::Helpers::MissingHelperError.
AbstractController::Helpers::MissingHelperErrorRemoves deprecated constant ActionDispatch::IllegalStateError.
ActionDispatch::IllegalStateErrorRemoves deprecated :exponentially_longer value for :wait in retry_on.
retry_on:wait:exponentially_longerRemoves deprecated support for setting numeric values to the scheduled_at attribute.
scheduled_atRemoves deprecated primitive serializer for BigDecimal arguments.
BigDecimalRemoves deprecated params via :args for assert_enqueued_email_with.
assert_enqueued_email_with:argsRemoves deprecated config.action_mailer.preview_path.
config.action_mailer.preview_pathRemoves deprecated config.active_storage.silence_invalid_content_types_warning.
config.active_storage.silence_invalid_content_types_warningRemoves deprecated config.active_storage.replace_on_assign_to_many.
config.active_storage.replace_on_assign_to_manyRemoves 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:changesqlite3mysqlpostgresqltrilogyRemoves the deprecated find_cmd_and_exec console helper.
find_cmd_and_execRemoves deprecated Rails.config.enable_dependency_loading.
Rails.config.enable_dependency_loadingRemoves deprecated Rails.application.secrets.
Rails.application.secretsRemoves deprecated support for the pre-Ruby 2.4 behavior of to_time returning a Time with local timezone.
to_timeRenames ActionView::TestCase::Behavior::Content to ActionView::TestCase::Behavior::RenderedViewContent, which now inherits from String.
ActionView::TestCase::Behavior::ContentActionView::TestCase::Behavior::RenderedViewContentRenames ActionView::TestCase::Behavior::Content to RenderedViewContent, which now inherits from String and is marked nodoc.
ActionView::TestCase::Behavior::ContentActionView::TestCase::Behavior::RenderedViewContentRemoves deprecated support for generating incorrect RFC 4122 UUIDs when the namespace ID is not a Digest::UUID constant.
Digest::UUIDRemoves implicit conversion of objects into String by ActiveSupport::SafeBuffer.
ActiveSupport::SafeBufferRemoves the deprecated active_support/core_ext/range/include_time_with_zone file.
active_support/core_ext/range/include_time_with_zoneRemoves the deprecated override of ActiveSupport::TimeWithZone.name.
ActiveSupport::TimeWithZone.nameRemoves 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_sRemoves deprecated ActiveSupport::PerThreadRegistry.
ActiveSupport::PerThreadRegistryRemoves the deprecated override of Enumerable#sum.
Enumerable#sumRenames add_unique_key and remove_unique_key to add_unique_constraint and remove_unique_constraint.
add_unique_keyremove_unique_keyadd_unique_constraintremove_unique_constraintRemoves deprecated Tasks::DatabaseTasks.schema_file_type.
Tasks::DatabaseTasks.schema_file_typeRemoves deprecated config.active_record.partial_writes.
config.active_record.partial_writesRemoves deprecated ActiveRecord::Base config accessors.
ActiveRecord::BaseRemoves the :include_replicas argument from configs_for; use :include_hidden instead.
configs_for:include_replicas:include_hiddenMoves ActiveRecord::InternalMetadata to an independent object no longer inheriting from ActiveRecord::Base.
ActiveRecord::InternalMetadataActiveRecord::BaseActiveRecord::Base.connection.schema_migrationActiveRecord::SchemaMigrationRemoves ActiveRecord.legacy_connection_handling.
ActiveRecord.legacy_connection_handlingRemoves the --no-comments flag in PostgreSQL structure dumps; set structure_dump_flags instead.
--no-commentsActiveRecord::Tasks::DatabaseTasks.structure_dump_flagsRenames add_unique_key and remove_unique_key to add_unique_constraint and remove_unique_constraint.
add_unique_keyremove_unique_keyadd_unique_constraintremove_unique_constraintRemoves deprecated Tasks::DatabaseTasks.schema_file_type.
Tasks::DatabaseTasks.schema_file_typeRemoves deprecated config.active_record.partial_writes.
config.active_record.partial_writesRemoves deprecated ActiveRecord::Base config accessors.
ActiveRecord::BaseRemoves the :include_replicas argument from configs_for in favor of :include_hidden.
configs_forinclude_replicasinclude_hiddenMoves ActiveRecord::InternalMetadata to an independent object that no longer inherits from ActiveRecord::Base.
ActiveRecord::InternalMetadataActiveRecord::BaseActiveRecord::Base.connection.schema_migrationActiveRecord::SchemaMigration no longer inherits from ActiveRecord::Base and must be instantiated with a connection.
ActiveRecord::SchemaMigrationActiveRecord::BaseActiveRecord::Base.connection.schema_migrationChanges QueryMethods#in_order_of to drop records not listed in values, matching the Enumerable version.
QueryMethods#in_order_ofRemoves the deprecated MAILGUN_INGRESS_API_KEY environment variable.
MAILGUN_INGRESS_API_KEYRemoves the deprecated Rails.application.credentials.action_mailbox.mailgun_api_key credential.
Rails.application.credentials.action_mailbox.mailgun_api_keyRemoves deprecated ActionMailer::DeliveryJob and ActionMailer::Parameterized::DeliveryJob in favor of ActionMailer::MailDeliveryJob.
ActionMailer::DeliveryJobActionMailer::Parameterized::DeliveryJobActionMailer::MailDeliveryJobRemoves deprecated
Rails.config.action_view.raise_on_missing_translations.Rails.config.action_view.raise_on_missing_translationsRemoves deprecated support for passing a path to
fixture_file_upload relative to fixture_path.fixture_file_uploadfixture_pathRemoves deprecated
ActionDispatch::SystemTestCase#host!.ActionDispatch::SystemTestCase#host!Removes deprecated
Rails.config.action_dispatch.hosts_response_app.Rails.config.action_dispatch.hosts_response_appRemoves deprecated
ActionDispatch::Response.return_only_media_type_on_content_type.ActionDispatch::Response.return_only_media_type_on_content_typeDrops support for the SERVER_ADDR header.
SERVER_ADDRRemoves the legacy default media=screen from stylesheet_link_tag.
stylesheet_link_tagRemoves the deprecated
:return_false_on_aborted_enqueue option.:return_false_on_aborted_enqueueRemoves deprecated behavior that did not halt
after_enqueue/after_perform callbacks when a previous callback was halted with throw :abort.after_enqueueafter_performthrow :abortRemoves support for Marshal loading the Rails 5.x
ActiveModel::AttributeSet format.ActiveModel::AttributeSetRemoves 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#messagesdeleteRemoves deprecated support for
clear on ActiveModel::Errors#messages.ActiveModel::Errors#messagesclearRemoves deprecated support for concatenating errors to
ActiveModel::Errors#messages.ActiveModel::Errors#messagesRemoves deprecated
ActiveModel::Errors#to_xml.ActiveModel::Errors#to_xmlRemoves deprecated
ActiveModel::Errors#keys.ActiveModel::Errors#keysRemoves deprecated ActiveModel::Errors#values.
ActiveModel::Errors#valuesRemoves deprecated ActiveModel::Errors#slice!.
ActiveModel::Errors#slice!Removes deprecated ActiveModel::Errors#to_h.
ActiveModel::Errors#to_hRemoves deprecated enumeration of ActiveModel::Errors instances as a Hash.
ActiveModel::ErrorsRemoves deprecated ActiveRecord::DatabaseConfigurations::DatabaseConfig#spec_name.
ActiveRecord::DatabaseConfigurations::DatabaseConfig#spec_nameRemoves deprecated ActiveRecord::Connection#in_clause_length.
ActiveRecord::Connection#in_clause_lengthRemoves deprecated ActiveRecord::Connection#allowed_index_name_length.
ActiveRecord::Connection#allowed_index_name_lengthRemoves deprecated ActiveRecord::Base#remove_connection.
ActiveRecord::Base#remove_connectionRemoves 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_hRemoves deprecated
ActiveRecord::Base.configurations.default_hash.ActiveRecord::Base.configurations.default_hashRemoves deprecated
ActiveRecord::Base.arel_attribute.ActiveRecord::Base.arel_attributeRemoves deprecated
ActiveRecord::Base.connection_config.ActiveRecord::Base.connection_configRemoves deprecated
Tasks::DatabaseTasks.spec.Tasks::DatabaseTasks.specRemoves deprecated
Tasks::DatabaseTasks.current_config.Tasks::DatabaseTasks.current_configRemoves deprecated
Tasks::DatabaseTasks.dump_filename.Tasks::DatabaseTasks.dump_filenameRemoves deprecated
Tasks::DatabaseTasks.schema_file.Tasks::DatabaseTasks.schema_fileRemoves 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).firstRemoves the deprecated DatabaseConfig#config method.
DatabaseConfig#configRemoves deprecated support to pass a column to type_cast.
type_castRemoves deprecated support to type cast ActiveRecord::Base objects to database values.
ActiveRecord::BaseRemoves deprecated support to quote ActiveRecord::Base objects.
ActiveRecord::BaseRemoves 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::BaseRemoves the deprecated :spec_name option in the configs_for method.
configs_for:spec_nameRemoves the deprecated ActiveRecord::Base.allow_unsafe_raw_sql setting.
ActiveRecord::Base.allow_unsafe_raw_sqlActiveRecord::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_toRemoves deprecated
build_after_upload, create_after_upload! and service_url methods.build_after_uploadcreate_after_upload!create_and_upload!service_urlurlRemoves the deprecated ActiveSupport::Multibyte::Unicode.default_normalization_form.
ActiveSupport::Multibyte::Unicode.default_normalization_formRemoves 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.parserRemoves the deprecated config.active_support.use_sha1_digests.
config.active_support.use_sha1_digestsRemoves the classic autoloader: ActiveSupport::Dependencies no longer installs a const_missing hook.
ActiveSupport::Dependenciesconst_missingDeletes the private API of ActiveSupport::Dependencies, including hook!, unhook!, depend_on, require_or_load and mechanism.
ActiveSupport::Dependencieshook!unhook!depend_onrequire_or_loadmechanismRemoves 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_storeFreezes ActiveSupport::Duration#parts and removes its writer methods, since durations are meant to be immutable value objects.
ActiveSupport::Duration#partsRemoves deprecated config in dbconsole.
configdbconsoleDeletes the
config.autoloader= setter; zeitwerk is now the only autoloading mode.config.autoloader=zeitwerkPrevents glob injection in DiskService#delete_prefixed by escaping glob metacharacters, breaking code that relied on glob expansion.
DiskService#delete_prefixedDir.globRemoves deprecated Rails::Generators::Testing::Behaviour.
Rails::Generators::Testing::BehaviourRaises 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::InvalidSignatureRaises ArgumentError when accepts_nested_attributes_for is declared more than once for an association in the same class.
accepts_nested_attributes_forArgumentErrorActiveRecord::Base.serialize now takes two distinct keyword arguments instead of one positional argument.
ActiveRecord::Base.serializeActiveRecord::Base#signed_id now raises when called on a new record instead of returning an unusable ID.
ActiveRecord::Base#signed_idRaises 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_defaultsInvalid options passed to migration methods like create_table and add_column now raise an error instead of being silently ignored.
create_tableadd_columnchange_column_null now raises when given a non-boolean argument instead of treating it as truthy.
change_column_nullMessageEncryptor#decrypt_and_verify now raises InvalidMessage for all ciphers, not InvalidSignature for non-AEAD ciphers.ActiveSupport::MessageEncryptor#decrypt_and_verifyActiveSupport::MessageEncryptor::InvalidMessageActiveSupport::MessageVerifier::InvalidSignatureActiveSupport::Deprecation instances now use their own disallowed_warnings; global methods are deprecated.
ActiveSupport::DeprecationActiveSupport::Deprecation.disallowed_warningsActiveSupport::Deprecation.warnRaises ArgumentError when accepts_nested_attributes_for is declared more than once for an association in the same class.
accepts_nested_attributes_forChanges ActiveRecord::Base.serialize to accept distinct coder: and type: keyword arguments instead of one positional argument.
ActiveRecord::Base.serializeActiveRecord::Base#signed_id now raises if called on a new record instead of returning an unusable ID based on id = nil.
ActiveRecord::Base#signed_idMoves ActiveRecord::SchemaMigration to an independent object.
ActiveRecord::SchemaMigrationReverts the ability to pass a service_name param to DirectUploadsController, introduced in 7.0.0.
DirectUploadsControllerservice_nameStops transpiling the UMD package generated as actioncable.js and drops IE11 testing that relied on it.
actioncable.jsWriting 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_typeFormBuilder#button now transforms formmethod attributes into _method form data for varied same-form actions.
ActionView::Helpers::FormBuilder#buttonformmethod_methodUrlHelper#button_to now always renders a button element, whether content is passed as an argument or a block.
ActionView::Helpers::UrlHelper#button_toMerging conditions on the same column now consistently replaces the earlier condition with the latter.
mergerewhereRemoves 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::BlamableDisallows autoloading reloadable classes or modules during initialization unless wrapped in a
to_prepare block.to_prepareFixture configurations (
_fixture) are now strictly validated and raise an error on unknown keys instead of silently ignoring them._fixtureSecurity44
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_magickRejects scientific notation in NumberConverter.
NumberConverterFixes SafeBuffer#% to preserve unsafe status.
SafeBuffer#%Improves performance of NumberToDelimitedConverter.
NumberToDelimitedConverterSkips blank attribute names in tag helpers to avoid generating invalid HTML.
Filters user supplied metadata in DirectUploadController.
DirectUploadControllerAdds 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_forInvalidKeyErrorDiskControllerCalls inspect on ids in RecordNotFound error messages.
RecordNotFoundRemoves dangerous transformations in Active Storage.
Sanitizes ActionText HTML ContentAttachment in the Trix edit view.
ActionText::ContentAttachmentFixes ReDoS in Accept header parsing.
Stops ActiveSupport::KeyGenerator#inspect from displaying the secret.
ActiveSupport::KeyGenerator#inspectActiveSupport::KeyGeneratorStops ActiveSupport::MessageEncryptor#inspect from displaying the secret.
ActiveSupport::MessageEncryptor#inspectActiveSupport::MessageEncryptorStops EncryptedConfiguration#inspect from displaying configuration contents and key file contents.
EncryptedConfiguration#inspectRails.application.credentialsStops showing secrets in ActiveRecord::Encryption::Cipher::Aes256Gcm#inspect output.
ActiveRecord::Encryption::Cipher::Aes256Gcm#inspectStops ActiveRecord::Encryption::Cipher::Aes256Gcm#inspect from showing the secret.
ActiveRecord::Encryption::Cipher::Aes256Gcm#inspectAdds 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_formatAvoids backtracking in plain_text_for_blockquote_node.
plain_text_for_blockquote_nodeIncludes the HTTP Permissions-Policy header on non-HTML content types.
Upgrades Trix to 1.3.2 to fix CVE-2024-34341.
TrixFixes a possible XSS vulnerability with the
translate method in controllers (CVE-2024-26143).translateModerate · CVSS 6.1Uses 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_toImplements SafeBuffer#bytesplice to address CVE-2023-28120.
SafeBuffer#bytespliceIgnores certain data-* attributes in rails-ujs when the element is contenteditable, addressing CVE-2023-23913.
rails-ujsAvoids regex backtracking in Inflector.underscore.
Inflector.underscoreMakes sanitize_as_sql_comment more strict by escaping comment delimiters and stripping one surrounding comment.
sanitize_as_sql_commentannotateAdds 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_64bitFixes 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-MatchUses string#split instead of regex for domain parts.
string#splitChanges 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_classesAdds 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_escapeEscapes dangerous characters in tag helper tag and attribute names per XML spec, and renames the :escape_attributes option to :escape.
:escape_attributes:escapeAdds image transformation validation via a configurable allow-list for Active Storage variants, plus a deny-list for arguments.
VariantFixes 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::ParseErrorCasts numbers and booleans bind parameters to string in the MySQL adapter to prevent implicit cast vulnerabilities.
User.whereFixes X_FORWARDED_HOST protection in Action Pack.
X_FORWARDED_HOSTPlatform1
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-vipsRuntimeErrorDeprecations to plan for
Deprecated70
Deprecates
ActiveSupport::ProxyObject in favor of Ruby's built-in BasicObject.ActiveSupport::ProxyObjectBasicObjectDeprecates ActiveRecord::ImmutableRelation in favor of ActiveRecord::UnmodifiableRelation.
ActiveRecord::ImmutableRelationActiveRecord::UnmodifiableRelationDeprecates the association option
query_constraints in favor of foreign_key.query_constraintsforeign_keyDeprecates ActiveRecord::Base.connection in favor of .lease_connection as a soft deprecation.
ActiveRecord::Base.connectionActiveRecord::Base.lease_connectionDeprecates ActiveRecord::ConnectionAdapters::ConnectionPool#connection in favor of lease_connection.
ActiveRecord::ConnectionAdapters::ConnectionPool#connectionActiveRecord::ConnectionAdapters::ConnectionPool#lease_connectionDeprecates Rails.application.config.active_record.commit_transaction_on_non_local_return.
Rails.application.config.active_record.commit_transaction_on_non_local_returnDeprecates Rails.application.config.active_record.allow_deprecated_singular_associations_name.
Rails.application.config.active_record.allow_deprecated_singular_associations_nameDeprecates ENV["SCHEMA_CACHE"] in favor of schema_cache_path in the database configuration.
ENV["SCHEMA_CACHE"]schema_cache_pathDeprecates 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_countDeprecates defining an enum with keyword arguments.
enumDeprecates passing strings to ActiveRecord::Tasks::DatabaseTasks.cache_dump_filename.
ActiveRecord::Tasks::DatabaseTasks.cache_dump_filenameActiveRecord::DatabaseConfigurations::DatabaseConfigDeprecates 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.brDeprecates
Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality.Rails.application.config.action_controller.allow_deprecated_parameters_hash_equalityDeprecates Rails.application.config.active_job.use_big_decimal_serialize.
Rails.application.config.active_job.use_big_decimal_serializeDeprecates config.active_support.to_time_preserves_timezone.
config.active_support.to_time_preserves_timezoneDeprecates DateAndTime::Compatibility.preserve_timezone.
DateAndTime::Compatibility.preserve_timezoneDeprecates SafeBuffer#clone_empty, which has not been used internally since Rails 4.2.0.
SafeBuffer#clone_emptyDeprecates 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.silenceDeprecates config.active_support.use_rfc4122_namespaced_uuids.
config.active_support.use_rfc4122_namespaced_uuidsDeprecates config.active_support.remove_deprecated_time_with_zone_name.
config.active_support.remove_deprecated_time_with_zone_nameDeprecates config.active_support.disable_to_s_conversion.
config.active_support.disable_to_s_conversionDeprecates initializing ActiveSupport::Cache::MemCacheStore with an instance of Dalli::Client.
ActiveSupport::Cache::MemCacheStoreDalli::ClientDeprecates the :pool_size and :pool_timeout options for cache store connection pooling in favor of :pool.
:pool_size:pool_timeoutpoolDeprecates preserving the pre-Ruby 2.4 behavior of to_time; warning appears only when the setting is false.
to_timeDeprecates 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.
mergerewhereDeprecates read_attribute(:id) returning the primary key when the primary key is not :id.
read_attribute(:id)#idDeprecates the name argument on #remove_connection without replacement.
#remove_connectionDeprecates 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_keydeferrableDeprecates 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_handlerDeprecates config.active_record.suppress_multiple_database_warning.
config.active_record.suppress_multiple_database_warningDeprecates quoting ActiveSupport::Duration as an integer in SQL string templates.
ActiveSupport::Durationto_iiso8601Deprecates all_connection_pools and makes connection_pool_list require an explicit role or :all.
all_connection_poolsconnection_pool_listAdds 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_nameSets scheduled_at as a Time object and deprecates assigning numeric/epoch values; enqueued_at deserializes as Time.
scheduled_atscheduled_at=enqueued_atDeprecates SafeBuffer#clone_empty, which has not been used internally since Rails 4.2.0.
SafeBuffer#clone_emptyDeprecates usage of the singleton ActiveSupport::Deprecation and deprecator-less deprecation calls.
ActiveSupport::DeprecationActiveSupport::Deprecation.warnModule.deprecatedeprecate_constantDeprecatedObjectProxyDeprecatedInstanceVariableProxyDeprecatedConstantProxyActiveSupport::Deprecation.silenceDeprecates :pool_size and :pool_timeout options for cache store connection pooling.
pool_sizepool_timeoutpoolDeprecates the rewhere argument on #merge without replacement; it will be removed in Rails 7.2.
mergerewhereDeprecates read_attribute(:id) returning the primary key when the primary key is not :id.
read_attributeidDeprecates the name argument on #remove_connection without replacement; call it on the class that established the connection.
#remove_connectionDeprecates 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_pathDeprecates 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_handlerDeprecates quoting ActiveSupport::Duration as an integer in SQL string templates.
ActiveSupport::Durationto_iiso8601Deprecates all_connection_pools and makes connection_pool_list require an explicit role or :all.
all_connection_poolsconnection_pool_listAdds a deprecation warning for using plural names of singular associations in where, with an opt-in config.
config.active_record.allow_deprecated_singular_associations_nameRenames action_cable.js to actioncable.js to match other Rails frameworks, with a JS console deprecation notice.
action_cable.jsactioncable.jsDeprecates Rails.application.config.action_controller.urlsafe_csrf_tokens, which is now always enabled.
Rails.application.config.action_controller.urlsafe_csrf_tokensDeprecates
poltergeist and webkit driver registration for system testing, to be removed in Rails 7.1, and adds cuprite.poltergeistwebkitcupriteDeprecates assigning a single value to config.action_dispatch.trusted_proxies because RemoteIp middleware behaves inconsistently.
config.action_dispatch.trusted_proxiesRemoteIpDeprecates assigning render locals to instance variables.
renderDeprecates
Rails.config.active_job.skip_after_callbacks_if_terminated.Rails.config.active_job.skip_after_callbacks_if_terminatedDeprecates
Tasks::DatabaseTasks.schema_file_type.Tasks::DatabaseTasks.schema_file_typeDeprecates
partial_writes in favor of partial_inserts and partial_updates.partial_writespartial_insertspartial_updatesDeprecates legacy_connection_handling.
legacy_connection_handlingDeprecates 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_warningDeprecates
ActiveStorage::Current.host in favor of ActiveStorage::Current.url_options.ActiveStorage::Current.hostActiveStorage::Current.url_optionsDeprecates
config.active_storage.replace_on_assign_to_many; future versions behave as when set to true.config.active_storage.replace_on_assign_to_manyDeprecates usage of
purge and purge_later from the association extension.purgepurge_laterDeprecates 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_sArrayRangeDateDateTimeTimeBigDecimalDeprecates 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_descendantsDeprecates 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.nameDeprecates Rails custom Enumerable#sum and Array#sum in favor of Ruby's native implementation, which requires an initializer for non-numeric types.
Enumerable#sumArray#sumRemoves
Rack::Runtime from the default middleware stack and deprecates referencing it in middleware operations without adding it back.Rack::RuntimeDeprecates 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#descendantsDeprecates 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