Ruby on Rails 7.2 Release Notes

Highlights in Rails 7.2:


1 Upgrading to Rails 7.2

If you're upgrading an existing application, it's a great idea to have good test coverage before going in. You should also first upgrade to Rails 7.1 in case you haven't and make sure your application still runs as expected before attempting an update to Rails 7.2. A list of things to watch out for when upgrading is available in the Upgrading Ruby on Rails guide.

2 Major Features

3 Railties

Please refer to the Changelog for detailed changes.

3.1 Removals

3.2 Deprecations

3.3 Notable changes

4 Action Cable

Please refer to the Changelog for detailed changes.

4.1 Removals

4.2 Deprecations

4.3 Notable changes

5 Action Pack

Please refer to the Changelog for detailed changes.

5.1 Removals

  • Remove deprecated constant ActionDispatch::IllegalStateError.

  • Remove deprecated constant AbstractController::Helpers::MissingHelperError.

  • Remove deprecated comparison between ActionController::Parameters and Hash.

  • Remove deprecated Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type.

  • Remove deprecated speaker, vibrate, and vr permissions policy directives.

  • Remove deprecated support to set Rails.application.config.action_dispatch.show_exceptions to true and false.

5.2 Deprecations

  • Deprecate Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality.

5.3 Notable changes

6 Action View

Please refer to the Changelog for detailed changes.

6.1 Removals

  • Remove deprecated @rails/ujs in favor of Turbo.

6.2 Deprecations

  • Deprecate passing content to void elements when using tag.br type tag builders.

6.3 Notable changes

7 Action Mailer

Please refer to the Changelog for detailed changes.

7.1 Removals

  • Remove deprecated config.action_mailer.preview_path.

  • Remove deprecated params via :args for assert_enqueued_email_with.

7.2 Deprecations

7.3 Notable changes

8 Active Record

Please refer to the Changelog for detailed changes.

8.1 Removals

  • Remove deprecated Rails.application.config.active_record.suppress_multiple_database_warning.

  • Remove deprecated support to call alias_attribute with non-existent attribute names.

  • Remove deprecated name argument from ActiveRecord::Base.remove_connection.

  • Remove deprecated ActiveRecord::Base.clear_active_connections!.

  • Remove deprecated ActiveRecord::Base.clear_reloadable_connections!.

  • Remove deprecated ActiveRecord::Base.clear_all_connections!.

  • Remove deprecated ActiveRecord::Base.flush_idle_connections!.

  • Remove deprecated ActiveRecord::ActiveJobRequiredError.

  • Remove deprecated support to define explain in the connection adapter with 2 arguments.

  • Remove deprecated ActiveRecord::LogSubscriber.runtime method.

  • Remove deprecated ActiveRecord::LogSubscriber.runtime= method.

  • Remove deprecated ActiveRecord::LogSubscriber.reset_runtime method.

  • Remove deprecated ActiveRecord::Migration.check_pending method.

  • Remove deprecated support to passing SchemaMigration and InternalMetadata classes as arguments to ActiveRecord::MigrationContext.

  • Remove deprecated behavior to support referring to a singular association by its plural name.

  • Remove deprecated TestFixtures.fixture_path.

  • Remove deprecated support to ActiveRecord::Base#read_attribute(:id) to return the custom primary key value.

  • Remove deprecated support to passing coder and class as second argument to serialize.

  • Remove deprecated #all_foreign_keys_valid? from database adapters.

  • Remove deprecated ActiveRecord::ConnectionAdapters::SchemaCache.load_from.

  • Remove deprecated ActiveRecord::ConnectionAdapters::SchemaCache#data_sources.

  • Remove deprecated #all_connection_pools.

  • Remove deprecated support to apply #connection_pool_list, #active_connections?, #clear_active_connections!, #clear_reloadable_connections!, #clear_all_connections! and #flush_idle_connections! to the connections pools for the current role when the role argument isn't provided.

  • Remove deprecated ActiveRecord::ConnectionAdapters::ConnectionPool#connection_klass.

  • Remove deprecated #quote_bound_value.

  • Remove deprecated support to quote ActiveSupport::Duration.

  • Remove deprecated support to pass deferrable: true to add_foreign_key.

  • Remove deprecated support to pass rewhere to ActiveRecord::Relation#merge.

  • Remove deprecated behavior that would rollback a transaction block when exited using return, break or throw.

8.2 Deprecations

  • Deprecate Rails.application.config.active_record.allow_deprecated_singular_associations_name

  • Deprecate Rails.application.config.active_record.commit_transaction_on_non_local_return

8.3 Notable changes

9 Active Storage

Please refer to the Changelog for detailed changes.

9.1 Removals

9.2 Deprecations

9.3 Notable changes

10 Active Model

Please refer to the Changelog for detailed changes.

10.1 Removals

10.2 Deprecations

10.3 Notable changes

11 Active Support

Please refer to the Changelog for detailed changes.

11.1 Removals

11.2 Deprecations

11.3 Notable changes

12 Active Job

Please refer to the Changelog for detailed changes.

12.1 Removals

  • Remove deprecated primitive serializer for BigDecimal arguments.

  • Remove deprecated support to set numeric values to scheduled_at attribute.

  • Remove deprecated :exponentially_longer value for the :wait in retry_on.

12.2 Deprecations

  • Deprecate Rails.application.config.active_job.use_big_decimal_serialize.

12.3 Notable changes

13 Action Text

Please refer to the Changelog for detailed changes.

13.1 Removals

13.2 Deprecations

13.3 Notable changes

14 Action Mailbox

Please refer to the Changelog for detailed changes.

14.1 Removals

14.2 Deprecations

14.3 Notable changes

15 Ruby on Rails Guides

Please refer to the Changelog for detailed changes.

15.1 Notable changes

16 Credits

See the full list of contributors to Rails for the many people who spent many hours making Rails, the stable and robust framework it is. Kudos to all of them.


Feedback

You're encouraged to help improve the quality of this guide.

Please contribute if you see any typos or factual errors. To get started, you can read our documentation contributions section.

You may also find incomplete content or stuff that is not up to date. Please do add any missing documentation for main. Make sure to check Edge Guides first to verify if the issues are already fixed or not on the main branch. Check the Ruby on Rails Guides Guidelines for style and conventions.

If for whatever reason you spot something to fix but cannot patch it yourself, please open an issue.

And last but not least, any kind of discussion regarding Ruby on Rails documentation is very welcome on the official Ruby on Rails Forum.