1. Upgrading to Rails 8.1
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 8.0 in case you haven't and make sure your application still runs as expected before attempting an update to Rails 8.1. 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
Remove deprecated
rails/console/methods.rb
file.Remove deprecated
bin/rake stats
command.Remove deprecated
STATS_DIRECTORIES
.
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 support to skipping over leading brackets in parameter names in the parameter parser.
Before:
ActionDispatch::ParamBuilder.from_query_string("[foo]=bar") # => { "foo" => "bar" } ActionDispatch::ParamBuilder.from_query_string("[foo][bar]=baz") # => { "foo" => { "bar" => "baz" } }
After:
ActionDispatch::ParamBuilder.from_query_string("[foo]=bar") # => { "[foo]" => "bar" } ActionDispatch::ParamBuilder.from_query_string("[foo][bar]=baz") # => { "[foo]" => { "bar" => "baz" } }
Remove deprecated support for using semicolons as a query string separator.
Before:
ActionDispatch::QueryParser.each_pair("foo=bar;baz=quux").to_a # => [["foo", "bar"], ["baz", "quux"]]
After:
ActionDispatch::QueryParser.each_pair("foo=bar;baz=quux").to_a # => [["foo", "bar;baz=quux"]]
Remove deprecated support to a route to multiple paths.
5.2. Deprecations
- Deprecate
Rails.application.config.action_dispatch.ignore_leading_brackets
.
5.3. Notable changes
- Redirects are now verbose in development for new Rails apps. To enable it in an existing app, add
config.action_dispatch.verbose_redirect_logs = true
to yourconfig/development.rb
file.
6. Action View
Please refer to the Changelog for detailed changes.
6.1. Removals
6.2. Deprecations
6.3. Notable changes
7. Action Mailer
Please refer to the Changelog for detailed changes.
7.1. Removals
7.2. Deprecations
7.3. Notable changes
8. Active Record
Please refer to the Changelog for detailed changes.
8.1. Removals
Remove deprecated
:retries
option for the SQLite3 adapter.Remove deprecated
:unsigned_float
and:unsigned_decimal
column methods for MySQL.
8.2. Deprecations
Deprecate using an order dependent finder method (e.g.
#first
) without anorder
.Deprecate
ActiveRecord::Base.signed_id_verifier_secret
in favor ofRails.application.message_verifiers
(orModel.signed_id_verifier
if the secret is specific to a model).Deprecate using
insert_all
/upsert_all
with unpersisted records in associations.Deprecate usage of
WITH
,WITH RECURSIVE
andDISTINCT
withupdate_all
.
8.3. Notable changes
- The table columns inside
schema.rb
are now sorted alphabetically.
9. Active Storage
Please refer to the Changelog for detailed changes.
9.1. Removals
- Remove deprecated
:azure
storage service.
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
Remove deprecated passing a Time object to
Time#since
.Remove deprecated
Benchmark.ms
method. It is now defined in thebenchmark
gem.Remove deprecated addition for
Time
instances withActiveSupport::TimeWithZone
.Remove deprecated support for
to_time
to preserve the system local time. It will now always preserve the receiver timezone.
11.2. Deprecations
Deprecate
config.active_support.to_time_preserves_timezone
.Deprecate
String#mb_chars
andActiveSupport::Multibyte::Chars
.Deprecate
ActiveSupport::Configurable
.
11.3. Notable changes
12. Active Job
Please refer to the Changelog for detailed changes.
12.1. Removals
Remove support to set
ActiveJob::Base.enqueue_after_transaction_commit
to:never
,:always
and:default
.Remove deprecated
Rails.application.config.active_job.enqueue_after_transaction_commit
.Remove deprecated internal
SuckerPunch
adapter in favor of the adapter included with thesucker_punch
gem.
12.2. Deprecations
Custom Active Job serializers must have a public
#klass
method.Deprecate built-in
sidekiq
adapter (now provided bysidekiq
gem).
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.