2020-05-05 03:57:39 +00:00
|
|
|
**DO NOT READ THIS FILE ON GITHUB, GUIDES ARE PUBLISHED ON https://guides.rubyonrails.org.**
|
|
|
|
|
|
|
|
Ruby on Rails 6.1 Release Notes
|
|
|
|
===============================
|
|
|
|
|
|
|
|
Highlights in Rails 6.1:
|
|
|
|
|
|
|
|
These release notes cover only the major changes. To learn about various bug
|
|
|
|
fixes and changes, please refer to the change logs or check out the [list of
|
|
|
|
commits](https://github.com/rails/rails/commits/master) in the main Rails
|
|
|
|
repository on GitHub.
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
Upgrading to Rails 6.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 6.0 in case you
|
|
|
|
haven't and make sure your application still runs as expected before attempting
|
|
|
|
an update to Rails 6.1. A list of things to watch out for when upgrading is
|
|
|
|
available in the
|
|
|
|
[Upgrading Ruby on Rails](upgrading_ruby_on_rails.html#upgrading-from-rails-6-0-to-rails-6-1)
|
|
|
|
guide.
|
|
|
|
|
|
|
|
Major Features
|
|
|
|
--------------
|
|
|
|
|
|
|
|
Railties
|
|
|
|
--------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][railties] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
2020-10-29 18:22:16 +00:00
|
|
|
* Remove deprecated `rake notes` tasks.
|
|
|
|
|
|
|
|
* Remove deprecated `connection` option in the `rails dbconsole` command.
|
2020-10-29 17:50:03 +00:00
|
|
|
|
2020-10-29 19:09:19 +00:00
|
|
|
* Remove deprecated `SOURCE_ANNOTATION_DIRECTORIES` environment variable support from `rails notes`.
|
|
|
|
|
2020-10-29 20:05:22 +00:00
|
|
|
* Remove deprecated `server` argument from the rails server command.
|
|
|
|
|
2020-10-29 20:41:13 +00:00
|
|
|
* Remove deprecated support for using the `HOST` environment variable to specify the server IP.
|
|
|
|
|
2020-10-29 21:17:17 +00:00
|
|
|
* Remove deprecated `rake dev:cache` tasks.
|
|
|
|
|
2020-10-29 21:18:29 +00:00
|
|
|
* Remove deprecated `rake routes` tasks.
|
|
|
|
|
2020-05-05 03:57:39 +00:00
|
|
|
### 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
|
|
|
|
|
2020-05-07 00:44:44 +00:00
|
|
|
* Remove deprecated `ActionDispatch::Http::ParameterFilter`.
|
|
|
|
|
|
|
|
* Remove deprecated `force_ssl` at the controller level.
|
|
|
|
|
|
|
|
### Deprecations
|
|
|
|
|
2020-10-28 19:09:38 +00:00
|
|
|
* Deprecate `config.action_dispatch.return_only_media_type_on_content_type`.
|
|
|
|
|
2020-05-07 00:44:44 +00:00
|
|
|
### Notable changes
|
|
|
|
|
2020-10-28 19:09:38 +00:00
|
|
|
* Change `ActionDispatch::Response#content_type` to return the full Content-Type header.
|
|
|
|
|
2020-05-07 00:44:44 +00:00
|
|
|
Action View
|
|
|
|
-----------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][action-view] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
2020-05-07 00:19:54 +00:00
|
|
|
* Remove deprecated `escape_whitelist` from `ActionView::Template::Handlers::ERB`.
|
|
|
|
|
2020-05-06 22:21:19 +00:00
|
|
|
* Remove deprecated `find_all_anywhere` from `ActionView::Resolver`.
|
|
|
|
|
2020-05-06 22:18:01 +00:00
|
|
|
* Remove deprecated `formats` from `ActionView::Template::HTML`.
|
|
|
|
|
2020-05-06 22:16:38 +00:00
|
|
|
* Remove deprecated `formats` from `ActionView::Template::RawFile`.
|
|
|
|
|
2020-05-06 22:15:09 +00:00
|
|
|
* Remove deprecated `formats` from `ActionView::Template::Text`.
|
|
|
|
|
2020-05-06 22:10:28 +00:00
|
|
|
* Remove deprecated `find_file` from `ActionView::PathSet`.
|
|
|
|
|
2020-05-06 21:57:29 +00:00
|
|
|
* Remove deprecated `rendered_format` from `ActionView::LookupContext`.
|
|
|
|
|
2020-05-06 21:53:39 +00:00
|
|
|
* Remove deprecated `find_file` from `ActionView::ViewPaths`.
|
|
|
|
|
2020-05-06 21:31:39 +00:00
|
|
|
* Require that `ActionView::Base` subclasses implement `#compiled_method_container`.
|
|
|
|
|
2020-05-06 20:28:34 +00:00
|
|
|
* Remove deprecated support to pass an object that is not a `ActionView::LookupContext` as the first argument
|
|
|
|
in `ActionView::Base#initialize`.
|
|
|
|
|
2020-05-06 17:21:07 +00:00
|
|
|
* Remove deprecated `format` argument `ActionView::Base#initialize`.
|
|
|
|
|
2020-05-05 23:33:47 +00:00
|
|
|
* Remove deprecated `ActionView::Template#refresh`.
|
|
|
|
|
2020-05-05 23:32:32 +00:00
|
|
|
* Remove deprecated `ActionView::Template#original_encoding`.
|
|
|
|
|
2020-05-05 23:31:11 +00:00
|
|
|
* Remove deprecated `ActionView::Template#variants`.
|
|
|
|
|
2020-05-05 23:29:59 +00:00
|
|
|
* Remove deprecated `ActionView::Template#formats`.
|
|
|
|
|
2020-05-05 23:27:21 +00:00
|
|
|
* Remove deprecated `ActionView::Template#virtual_path=`.
|
|
|
|
|
2020-05-05 23:23:24 +00:00
|
|
|
* Remove deprecated `ActionView::Template#updated_at`.
|
|
|
|
|
|
|
|
* Remove deprecated `updated_at` argument required on `ActionView::Template#initialize`.
|
|
|
|
|
2020-05-05 23:08:13 +00:00
|
|
|
* Make `locals` argument required on `ActionView::Template#initialize`.
|
|
|
|
|
2020-05-05 21:29:27 +00:00
|
|
|
* Remove deprecated `ActionView::Template.finalize_compiled_template_methods`.
|
|
|
|
|
|
|
|
* Remove deprecated `config.action_view.finalize_compiled_template_methods`
|
|
|
|
|
2020-05-05 20:37:29 +00:00
|
|
|
* Remove deprecated support to calling `ActionView::ViewPaths#with_fallback` with a block.
|
|
|
|
|
2020-05-05 20:13:01 +00:00
|
|
|
* Remove deprecated support to passing absolute paths to `render template:`.
|
|
|
|
|
2020-05-05 19:58:55 +00:00
|
|
|
* Remove deprecated support to passing relative paths to `render file:`.
|
|
|
|
|
2020-05-05 15:20:48 +00:00
|
|
|
* Remove support to template handlers that don't accept two arguments.
|
|
|
|
|
2020-05-05 05:45:21 +00:00
|
|
|
* Remove deprecated pattern argument in `ActionView::Template::PathResolver`.
|
|
|
|
|
2020-05-05 05:28:48 +00:00
|
|
|
* Remove deprecated support to call private methods from object in some view helpers.
|
|
|
|
|
2020-05-05 03:57:39 +00:00
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Action Mailer
|
|
|
|
-------------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][action-mailer] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
|
|
|
* Remove deprecated `ActionMailer::Base.receive` in favor of [Action Mailbox](https://github.com/rails/rails/tree/master/actionmailbox).
|
|
|
|
|
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Active Record
|
|
|
|
-------------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][active-record] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
2020-05-07 19:21:23 +00:00
|
|
|
|
2020-05-07 18:42:25 +00:00
|
|
|
* MySQL: Uniqueness validator now respects default database collation,
|
|
|
|
no longer enforce case sensitive comparison by default.
|
|
|
|
|
2020-05-07 19:51:03 +00:00
|
|
|
* Remove deprecated methods from `ActiveRecord::ConnectionAdapters::DatabaseLimits`.
|
|
|
|
|
|
|
|
`column_name_length`
|
|
|
|
`table_name_length`
|
|
|
|
`columns_per_table`
|
|
|
|
`indexes_per_table`
|
|
|
|
`columns_per_multicolumn_index`
|
|
|
|
`sql_query_length`
|
|
|
|
`joins_per_query`
|
|
|
|
|
2020-05-07 19:36:59 +00:00
|
|
|
* Remove deprecated `ActiveRecord::ConnectionAdapters::AbstractAdapter#supports_multi_insert?`.
|
|
|
|
|
2020-05-07 19:21:23 +00:00
|
|
|
* Remove deprecated `ActiveRecord::ConnectionAdapters::AbstractAdapter#supports_foreign_keys_in_create?`.
|
2020-05-05 03:57:39 +00:00
|
|
|
|
2020-05-07 19:16:15 +00:00
|
|
|
* Remove deprecated `ActiveRecord::ConnectionAdapters::PostgreSQLAdapter#supports_ranges?`.
|
|
|
|
|
2020-05-07 18:36:23 +00:00
|
|
|
* Remove deprecated `ActiveRecord::Base#update_attributes` and `ActiveRecord::Base#update_attributes!`.
|
|
|
|
|
2020-05-07 16:32:44 +00:00
|
|
|
* Remove deprecated `migrations_path` argument in
|
|
|
|
`ActiveRecord::ConnectionAdapter::SchemaStatements#assume_migrated_upto_version`.
|
|
|
|
|
2020-05-07 16:10:22 +00:00
|
|
|
* Remove deprecated `config.active_record.sqlite3.represent_boolean_as_integer`.
|
|
|
|
|
2020-05-07 04:23:18 +00:00
|
|
|
* Remove deprecated methods from `ActiveRecord::DatabaseConfigurations`.
|
|
|
|
|
|
|
|
`fetch`
|
|
|
|
`each`
|
|
|
|
`first`
|
|
|
|
`values`
|
|
|
|
`[]=`
|
|
|
|
|
2020-05-07 03:03:58 +00:00
|
|
|
* Remove deprecated `ActiveRecord::Result#to_hash` method.
|
|
|
|
|
2020-05-07 02:55:55 +00:00
|
|
|
* Remove deprecated support for using unsafe raw SQL in `ActiveRecord::Relation` methods.
|
|
|
|
|
2020-05-05 03:57:39 +00:00
|
|
|
### Deprecations
|
|
|
|
|
2020-05-07 02:55:55 +00:00
|
|
|
* Deprecate `ActiveRecord::Base.allow_unsafe_raw_sql`.
|
|
|
|
|
2020-05-05 03:57:39 +00:00
|
|
|
### Notable changes
|
|
|
|
|
2020-05-07 09:30:33 +00:00
|
|
|
* `relation.create` does no longer leak scope to class level querying methods
|
|
|
|
in initialization block and callbacks.
|
|
|
|
|
|
|
|
Before:
|
|
|
|
|
|
|
|
User.where(name: "John").create do |john|
|
|
|
|
User.find_by(name: "David") # => nil
|
|
|
|
end
|
|
|
|
|
|
|
|
After:
|
|
|
|
|
|
|
|
User.where(name: "John").create do |john|
|
|
|
|
User.find_by(name: "David") # => #<User name: "David", ...>
|
|
|
|
end
|
|
|
|
|
|
|
|
* Named scope chain does no longer leak scope to class level querying methods.
|
|
|
|
|
|
|
|
class class User < ActiveRecord::Base
|
|
|
|
scope :david, -> { User.where(name: "David") }
|
|
|
|
end
|
|
|
|
|
|
|
|
Before:
|
|
|
|
|
|
|
|
User.where(name: "John").david
|
|
|
|
# SELECT * FROM users WHERE name = 'John' AND name = 'David'
|
|
|
|
|
|
|
|
After:
|
|
|
|
|
|
|
|
User.where(name: "John").david
|
|
|
|
# SELECT * FROM users WHERE name = 'David'
|
|
|
|
|
2020-05-07 04:00:27 +00:00
|
|
|
* `where.not` now generates NAND predicates instead of NOR.
|
|
|
|
|
|
|
|
Before:
|
|
|
|
|
|
|
|
User.where.not(name: "Jon", role: "admin")
|
|
|
|
# SELECT * FROM users WHERE name != 'Jon' AND role != 'admin'
|
|
|
|
|
|
|
|
After:
|
|
|
|
|
|
|
|
User.where.not(name: "Jon", role: "admin")
|
|
|
|
# SELECT * FROM users WHERE NOT (name == 'Jon' AND role == 'admin')
|
|
|
|
|
2020-05-05 03:57:39 +00:00
|
|
|
Active Storage
|
|
|
|
--------------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][active-storage] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
2020-05-11 17:58:19 +00:00
|
|
|
* Remove deprecated support to pass `:combine_options` operations to `ActiveStorage::Transformers::ImageProcessing`.
|
|
|
|
|
2020-05-11 17:31:37 +00:00
|
|
|
* Remove deprecated `ActiveStorage::Transformers::MiniMagickTransformer`.
|
|
|
|
|
2020-05-07 20:25:22 +00:00
|
|
|
* Remove deprecated `config.active_storage.queue`.
|
|
|
|
|
2020-05-07 20:13:56 +00:00
|
|
|
* Remove deprecated `ActiveStorage::Downloading`.
|
|
|
|
|
2020-05-05 03:57:39 +00:00
|
|
|
### Deprecations
|
|
|
|
|
2020-05-11 17:43:33 +00:00
|
|
|
* Deprecate `Blob.create_after_upload` in favor of `Blob.create_and_upload`.
|
|
|
|
([Pull Request](https://github.com/rails/rails/pull/34827))
|
|
|
|
|
2020-05-05 03:57:39 +00:00
|
|
|
### Notable changes
|
|
|
|
|
2020-05-11 17:43:33 +00:00
|
|
|
* Add `Blob.create_and_upload` to create a new blob and upload the given `io`
|
|
|
|
to the service.
|
|
|
|
([Pull Request](https://github.com/rails/rails/pull/34827))
|
|
|
|
|
2020-05-05 03:57:39 +00:00
|
|
|
Active Model
|
|
|
|
------------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][active-model] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Active Support
|
|
|
|
--------------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][active-support] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
2020-10-28 21:05:48 +00:00
|
|
|
* Remove deprecated fallback to `I18n.default_local` when `config.i18n.fallbacks` is empty.
|
|
|
|
|
2020-10-28 21:10:24 +00:00
|
|
|
* Remove deprecated `LoggerSilence` constant.
|
|
|
|
|
2020-10-28 21:41:16 +00:00
|
|
|
* Remove deprecated `ActiveSupport::LoggerThreadSafeLevel#after_initialize`.
|
|
|
|
|
2020-10-28 21:44:11 +00:00
|
|
|
* Remove deprecated `Module#parent_name`, `Module#parent` and `Module#parents`.
|
|
|
|
|
2020-10-28 21:47:56 +00:00
|
|
|
* Remove deprecated file `active_support/core_ext/module/reachable`.
|
|
|
|
|
2020-10-28 21:51:17 +00:00
|
|
|
* Remove deprecated file `active_support/core_ext/numeric/inquiry`.
|
|
|
|
|
2020-10-28 21:53:08 +00:00
|
|
|
* Remove deprecated file `active_support/core_ext/array/prepend_and_append`.
|
|
|
|
|
2020-10-28 21:56:03 +00:00
|
|
|
* Remove deprecated file `active_support/core_ext/hash/compact`.
|
|
|
|
|
2020-10-28 22:02:52 +00:00
|
|
|
* Remove deprecated file `active_support/core_ext/hash/transform_values`.
|
|
|
|
|
2020-10-28 22:12:00 +00:00
|
|
|
* Remove deprecated file `active_support/core_ext/range/include_range`.
|
|
|
|
|
2020-10-28 22:25:13 +00:00
|
|
|
* Remove deprecated `ActiveSupport::Multibyte::Chars#consumes?` and `ActiveSupport::Multibyte::Chars#normalize`.
|
|
|
|
|
2020-10-29 15:43:33 +00:00
|
|
|
* Remove deprecated `ActiveSupport::Multibyte::Unicode.pack_graphemes`,
|
|
|
|
`ActiveSupport::Multibyte::Unicode.unpack_graphemes`,
|
|
|
|
`ActiveSupport::Multibyte::Unicode.normalize`,
|
|
|
|
`ActiveSupport::Multibyte::Unicode.downcase`,
|
|
|
|
`ActiveSupport::Multibyte::Unicode.upcase` and `ActiveSupport::Multibyte::Unicode.swapcase`.
|
|
|
|
|
2020-10-29 16:33:37 +00:00
|
|
|
* Remove deprecated `ActiveSupport::Notifications::Instrumenter#end=`.
|
|
|
|
|
2020-05-05 03:57:39 +00:00
|
|
|
### Deprecations
|
|
|
|
|
2020-10-29 16:07:24 +00:00
|
|
|
* Deprecate `ActiveSupport::Multibyte::Unicode.default_normalization_form`.
|
|
|
|
|
2020-05-05 03:57:39 +00:00
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
Active Job
|
|
|
|
----------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][active-job] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
|
|
|
### Deprecations
|
|
|
|
|
2020-05-07 00:44:44 +00:00
|
|
|
* Deprecate `config.active_job.return_false_on_aborted_enqueue`.
|
|
|
|
|
2020-05-05 03:57:39 +00:00
|
|
|
### Notable changes
|
|
|
|
|
2020-05-07 00:44:44 +00:00
|
|
|
* Return `false` when enqueuing a job is aborted.
|
|
|
|
|
2020-05-11 17:43:33 +00:00
|
|
|
Action Text
|
|
|
|
----------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][action-text] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
|
|
|
* Add method to confirm rich text content existence by adding `?` after
|
|
|
|
name of the rich text attribute.
|
|
|
|
([Pull Request](https://github.com/rails/rails/pull/37951))
|
|
|
|
|
|
|
|
* Add `fill_in_rich_text_area` system test case helper to find a trix
|
|
|
|
editor and fill it with given HTML content.
|
|
|
|
([Pull Request](https://github.com/rails/rails/pull/35885))
|
|
|
|
|
|
|
|
Action Mailbox
|
|
|
|
----------
|
|
|
|
|
|
|
|
Please refer to the [Changelog][action-mailbox] for detailed changes.
|
|
|
|
|
|
|
|
### Removals
|
|
|
|
|
|
|
|
### Deprecations
|
|
|
|
|
|
|
|
### Notable changes
|
|
|
|
|
2020-05-05 03:57:39 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|
[railties]: https://github.com/rails/rails/blob/master/railties/CHANGELOG.md
|
|
|
|
[action-pack]: https://github.com/rails/rails/blob/master/actionpack/CHANGELOG.md
|
|
|
|
[action-view]: https://github.com/rails/rails/blob/master/actionview/CHANGELOG.md
|
|
|
|
[action-mailer]: https://github.com/rails/rails/blob/master/actionmailer/CHANGELOG.md
|
|
|
|
[action-cable]: https://github.com/rails/rails/blob/master/actioncable/CHANGELOG.md
|
|
|
|
[active-record]: https://github.com/rails/rails/blob/master/activerecord/CHANGELOG.md
|
|
|
|
[active-storage]: https://github.com/rails/rails/blob/master/activestorage/CHANGELOG.md
|
|
|
|
[active-model]: https://github.com/rails/rails/blob/master/activemodel/CHANGELOG.md
|
|
|
|
[active-support]: https://github.com/rails/rails/blob/master/activesupport/CHANGELOG.md
|
|
|
|
[active-job]: https://github.com/rails/rails/blob/master/activejob/CHANGELOG.md
|
2020-05-11 17:43:33 +00:00
|
|
|
[action-text]: https://github.com/rails/rails/blob/master/actiontext/CHANGELOG.md
|
|
|
|
[action-mailbox]: https://github.com/rails/rails/blob/master/actionmailbox/CHANGELOG.md
|
2020-05-05 03:57:39 +00:00
|
|
|
[guides]: https://github.com/rails/rails/blob/master/guides/CHANGELOG.md
|