2020-12-17 15:00:58 -05:00
|
|
|
**DO NOT READ THIS FILE ON GITHUB, GUIDES ARE PUBLISHED ON https://guides.rubyonrails.org.**
|
|
|
|
|
2021-02-04 11:46:53 -05:00
|
|
|
Ruby on Rails 7.0 Release Notes
|
2020-12-17 15:00:58 -05:00
|
|
|
===============================
|
|
|
|
|
2021-02-04 11:46:53 -05:00
|
|
|
Highlights in Rails 7.0:
|
|
|
|
|
2021-02-06 14:12:51 -05:00
|
|
|
* Ruby 2.7.0+ required, Ruby 3.0+ preferred
|
2020-12-17 15:00:58 -05:00
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
2021-02-04 11:46:53 -05:00
|
|
|
Upgrading to Rails 7.0
|
2020-12-17 15:00:58 -05:00
|
|
|
----------------------
|
|
|
|
|
|
|
|
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 6.1 in case you
|
|
|
|
haven't and make sure your application still runs as expected before attempting
|
2021-02-04 11:46:53 -05:00
|
|
|
an update to Rails 7.0. A list of things to watch out for when upgrading is
|
2020-12-17 15:00:58 -05:00
|
|
|
available in the
|
2021-02-25 16:25:27 -05:00
|
|
|
[Upgrading Ruby on Rails](upgrading_ruby_on_rails.html#upgrading-from-rails-6-1-to-rails-7-0)
|
2020-12-17 15:00:58 -05:00
|
|
|
guide.
|
|
|
|
|
|
|
|
Major Features
|
|
|
|
--------------
|
|
|
|
|
|
|
|
Railties
|
|
|
|
--------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][railties] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Action Cable
|
|
|
|
------------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][action-cable] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Action Pack
|
|
|
|
-----------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][action-pack] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
2021-10-13 12:46:18 -04:00
|
|
|
* Remove deprecated `ActionDispatch::Response.return_only_media_type_on_content_type`.
|
|
|
|
|
2021-10-13 16:46:26 -04:00
|
|
|
* Remove deprecated `Rails.config.action_dispatch.hosts_response_app`.
|
|
|
|
|
2021-10-13 16:52:22 -04:00
|
|
|
* Remove deprecated `ActionDispatch::SystemTestCase#host!`.
|
|
|
|
|
2021-10-14 17:51:50 -04:00
|
|
|
* Remove deprecated support to passing a path to `fixture_file_upload` relative to `fixture_path`.
|
|
|
|
|
2020-12-17 15:00:58 -05:00
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Action View
|
|
|
|
-----------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][action-view] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
2021-10-14 18:09:03 -04:00
|
|
|
* Remove deprecated `Rails.config.action_view.raise_on_missing_translations`.
|
|
|
|
|
2020-12-17 15:00:58 -05:00
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Action Mailer
|
|
|
|
-------------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][action-mailer] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
2021-10-12 17:50:40 -04:00
|
|
|
* Remove deprecated `ActionMailer::DeliveryJob` and `ActionMailer::Parameterized::DeliveryJob`
|
|
|
|
in favor of `ActionMailer::MailDeliveryJob`.
|
|
|
|
|
2020-12-17 15:00:58 -05:00
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Active Record
|
|
|
|
-------------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][active-record] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
|
|
|
* Remove deprecated `database` kwarg from `connected_to`.
|
|
|
|
|
2021-11-16 15:02:35 -05:00
|
|
|
* Remove deprecated `ActiveRecord::Base.allow_unsafe_raw_sql`.
|
|
|
|
|
2021-11-16 15:18:08 -05:00
|
|
|
* Remove deprecated option `:spec_name` in the `configs_for` method.
|
|
|
|
|
2021-11-16 15:34:50 -05:00
|
|
|
* Remove deprecated support to YAML load `ActiveRecord::Base` instance in the Rails 4.2 and 4.1 formats.
|
|
|
|
|
2021-11-17 13:50:24 -05:00
|
|
|
* Remove deprecation warning when using `:interval` column is used in PostgreSQL database.
|
|
|
|
|
|
|
|
Now, interval columns will return `ActiveSupport::Duration` objects instead of strings.
|
|
|
|
|
|
|
|
To keep the old behavior, you can add this line to your model:
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
attribute :column, :string
|
|
|
|
```
|
|
|
|
|
2021-11-17 14:12:13 -05:00
|
|
|
* Remove deprecacated support to resolve connection using `"primary"` as connection specification name.
|
|
|
|
|
2021-11-17 14:21:11 -05:00
|
|
|
* Remove deprecated support to quote `ActiveRecord::Base` objects.
|
|
|
|
|
2021-11-17 14:27:02 -05:00
|
|
|
* Remove deprecated support to type cast to database values `ActiveRecord::Base` objects.
|
|
|
|
|
2021-11-17 16:20:21 -05:00
|
|
|
* Remove deprecated support to pass a column to `type_cast`.
|
|
|
|
|
2021-11-17 17:41:10 -05:00
|
|
|
* Remove deprecated `DatabaseConfig#config` method.
|
|
|
|
|
2021-11-17 18:08:29 -05:00
|
|
|
* Remove 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:test:load_structure`
|
|
|
|
* `db:test:load_structure:#{name}`
|
|
|
|
|
2020-12-17 15:00:58 -05:00
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
2021-11-17 17:31:53 -05:00
|
|
|
* Rollback transactions when the block returns earlier than expected.
|
|
|
|
|
|
|
|
Before this change, when a transaction block returned early, the transaction would be committed.
|
|
|
|
|
|
|
|
The problem is that timeouts triggered inside the transaction block was also making the incomplete transaction
|
|
|
|
to be committed, so in order to avoid this mistake, the transaction block is rolled back.
|
|
|
|
|
2020-12-17 15:00:58 -05:00
|
|
|
Active Storage
|
|
|
|
--------------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][active-storage] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Active Model
|
|
|
|
------------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][active-model] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
2021-11-15 18:53:00 -05:00
|
|
|
* Remove deprecated enumeration of `ActiveModel::Errors` instances as a Hash.
|
|
|
|
|
2021-11-15 19:01:29 -05:00
|
|
|
* Remove deprecated `ActiveModel::Errors#to_h`.
|
|
|
|
|
2021-11-15 19:04:37 -05:00
|
|
|
* Remove deprecated `ActiveModel::Errors#slice!`.
|
|
|
|
|
2021-11-15 19:06:05 -05:00
|
|
|
* Remove deprecated `ActiveModel::Errors#values`.
|
|
|
|
|
2021-11-15 19:08:36 -05:00
|
|
|
* Remove deprecated `ActiveModel::Errors#keys`.
|
|
|
|
|
2021-11-15 19:10:02 -05:00
|
|
|
* Remove deprecated `ActiveModel::Errors#to_xml`.
|
|
|
|
|
2021-11-15 19:50:35 -05:00
|
|
|
* Remove deprecated support concat errors to `ActiveModel::Errors#messages`.
|
|
|
|
|
2021-11-16 12:58:30 -05:00
|
|
|
* Remove deprecated support to `clear` errors from `ActiveModel::Errors#messages`.
|
2021-11-16 11:22:18 -05:00
|
|
|
|
2021-11-16 12:58:30 -05:00
|
|
|
* Remove deprecated support to `delete` errors from `ActiveModel::Errors#messages`.
|
|
|
|
|
|
|
|
* Remove deprecated support to use `[]=` in `ActiveModel::Errors#messages`.
|
2021-11-16 11:50:09 -05:00
|
|
|
|
2021-11-16 13:01:21 -05:00
|
|
|
* Remove support to Marshal and YAML load Rails 5.x error format.
|
|
|
|
|
2021-11-16 14:56:30 -05:00
|
|
|
* Remove support to Marshal load Rails 5.x `ActiveModel::AttributeSet` format.
|
|
|
|
|
2020-12-17 15:00:58 -05:00
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Active Support
|
|
|
|
--------------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][active-support] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Active Job
|
|
|
|
----------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][active-job] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
2021-10-14 18:29:35 -04:00
|
|
|
* Removed deprecated behavior that was not halting `after_enqueue`/`after_perform` callbacks when a
|
|
|
|
previous callback was halted with `throw :abort`.
|
|
|
|
|
2020-12-17 15:00:58 -05:00
|
|
|
### Deprecations
|
|
|
|
|
2021-10-14 18:29:35 -04:00
|
|
|
* Deprecated `Rails.config.active_job.skip_after_callbacks_if_terminated`.
|
|
|
|
|
2020-12-17 15:00:58 -05:00
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Action Text
|
|
|
|
----------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][action-text] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Action Mailbox
|
|
|
|
----------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][action-mailbox] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
2021-10-12 17:15:09 -04:00
|
|
|
* Removed deprecated `Rails.application.credentials.action_mailbox.mailgun_api_key`.
|
|
|
|
|
|
|
|
* Removed deprecated environment variable `MAILGUN_INGRESS_API_KEY`.
|
|
|
|
|
2020-12-17 15:00:58 -05:00
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Ruby on Rails Guides
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][guides] for detailed changes.
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Credits
|
|
|
|
-------
|
|
|
|
|
|
|
|
See the
|
|
|
|
[full list of contributors to Rails](https://contributors.rubyonrails.org/)
|
|
|
|
for the many people who spent many hours making Rails, the stable and robust
|
|
|
|
framework it is. Kudos to all of them.
|
|
|
|
|
2021-01-19 15:43:24 -05:00
|
|
|
[railties]: https://github.com/rails/rails/blob/main/railties/CHANGELOG.md
|
|
|
|
[action-pack]: https://github.com/rails/rails/blob/main/actionpack/CHANGELOG.md
|
|
|
|
[action-view]: https://github.com/rails/rails/blob/main/actionview/CHANGELOG.md
|
|
|
|
[action-mailer]: https://github.com/rails/rails/blob/main/actionmailer/CHANGELOG.md
|
|
|
|
[action-cable]: https://github.com/rails/rails/blob/main/actioncable/CHANGELOG.md
|
|
|
|
[active-record]: https://github.com/rails/rails/blob/main/activerecord/CHANGELOG.md
|
|
|
|
[active-storage]: https://github.com/rails/rails/blob/main/activestorage/CHANGELOG.md
|
|
|
|
[active-model]: https://github.com/rails/rails/blob/main/activemodel/CHANGELOG.md
|
|
|
|
[active-support]: https://github.com/rails/rails/blob/main/activesupport/CHANGELOG.md
|
|
|
|
[active-job]: https://github.com/rails/rails/blob/main/activejob/CHANGELOG.md
|
|
|
|
[action-text]: https://github.com/rails/rails/blob/main/actiontext/CHANGELOG.md
|
|
|
|
[action-mailbox]: https://github.com/rails/rails/blob/main/actionmailbox/CHANGELOG.md
|
|
|
|
[guides]: https://github.com/rails/rails/blob/main/guides/CHANGELOG.md
|