aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
Diffstat (limited to 'guides')
-rw-r--r--guides/source/5_1_release_notes.md4
-rw-r--r--guides/source/6_0_release_notes.md24
-rw-r--r--guides/source/configuring.md8
-rw-r--r--guides/source/getting_started.md2
-rw-r--r--guides/source/upgrading_ruby_on_rails.md40
5 files changed, 58 insertions, 20 deletions
diff --git a/guides/source/5_1_release_notes.md b/guides/source/5_1_release_notes.md
index e885b1e42e..f870c4c47c 100644
--- a/guides/source/5_1_release_notes.md
+++ b/guides/source/5_1_release_notes.md
@@ -41,8 +41,8 @@ Major Features
[Pull Request](https://github.com/rails/rails/pull/26836)
Rails 5.1 allows managing JavaScript dependencies
-from NPM via Yarn. This will make it easy to use libraries like React, VueJS
-or any other library from NPM world. The Yarn support is integrated with
+from npm via Yarn. This will make it easy to use libraries like React, VueJS
+or any other library from npm world. The Yarn support is integrated with
the asset pipeline so that all dependencies will work seamlessly with the
Rails 5.1 app.
diff --git a/guides/source/6_0_release_notes.md b/guides/source/6_0_release_notes.md
index cb3ea7737c..fa45e7240d 100644
--- a/guides/source/6_0_release_notes.md
+++ b/guides/source/6_0_release_notes.md
@@ -178,7 +178,7 @@ Please refer to the [Changelog][action-cable] for detailed changes.
`ActionCable::Connection`.
([Pull Request](https://github.com/rails/rails/pull/34194))
-* Convert the Action Cable Javascript package from CoffeeScript to ES2015 and
+* Convert the Action Cable JavaScript package from CoffeeScript to ES2015 and
publish the source code in the npm distribution.
([Pull Request](https://github.com/rails/rails/pull/34370))
@@ -202,7 +202,7 @@ Please refer to the [Changelog][action-pack] for detailed changes.
* Remove deprecated methods in `ActionDispatch::TestResponse`:
`#success?` in favor of `#successful?`, `#missing?` in favor of `#not_found?`,
- `#error?` in favor of `#server_error?`
+ `#error?` in favor of `#server_error?`.
([Commit](https://github.com/rails/rails/commit/13ddc92e079e59a0b894e31bf5bb4fdecbd235d1))
### Deprecations
@@ -229,7 +229,7 @@ Please refer to the [Changelog][action-pack] for detailed changes.
* Allow the use of `parsed_body` in `ActionController::TestCase`.
([Pull Request](https://github.com/rails/rails/pull/34717))
-* Raise an `ArgumentError` when multiple root routes exists in the same context
+* Raise an `ArgumentError` when multiple root routes exist in the same context
without `as:` naming specifications.
([Pull Request](https://github.com/rails/rails/pull/34494))
@@ -245,7 +245,7 @@ Please refer to the [Changelog][action-pack] for detailed changes.
* Expose `ActionController::Parameters#each_key`.
([Pull Request](https://github.com/rails/rails/pull/33758))
-* Add purpose metadata to signed/encrypted cookies to prevent copying the value of
+* Add purpose and expiry metadata inside signed/encrypted cookies to prevent copying the value of
cookies into one another.
([Pull Request](https://github.com/rails/rails/pull/32937))
@@ -298,14 +298,14 @@ Please refer to the [Changelog][action-view] for detailed changes.
### Notable changes
-* Clear ActionView cache in development only on file changes, speeding up
+* Clear Action View cache in development only on file changes, speeding up
development mode.
([Pull Request](https://github.com/rails/rails/pull/35629))
* Move all of the Rails npm packages into a `@rails` scope.
([Pull Request](https://github.com/rails/rails/pull/34905))
-* Only accept formats from registered Mime types.
+* Only accept formats from registered MIME types.
([Pull Request](https://github.com/rails/rails/pull/35604), [Pull Request](https://github.com/rails/rails/pull/35753))
* Add allocations to the template and partial rendering server output.
@@ -323,7 +323,7 @@ Please refer to the [Changelog][action-view] for detailed changes.
enable `ActionView::Template` finalizers.
([Pull Request](https://github.com/rails/rails/pull/32418))
-* Extract the JS `confirm` call to its own, overridable method in `rails_ujs`.
+* Extract the JavaScript `confirm` call to its own, overridable method in `rails_ujs`.
([Pull Request](https://github.com/rails/rails/pull/32404))
* Add a `action_controller.default_enforce_utf8` configuration option to handle
@@ -402,7 +402,7 @@ Please refer to the [Changelog][active-record] for detailed changes.
* Remove support for passing the column name to `count` when a block is passed.
([Commit](https://github.com/rails/rails/commit/67356f2034ab41305af7218f7c8b2fee2d614129))
-* Remove support for delegation of missing methods in a relation to arel.
+* Remove support for delegation of missing methods in a relation to Arel.
([Commit](https://github.com/rails/rails/commit/d97980a16d76ad190042b4d8578109714e9c53d0))
* Remove support for delegating missing methods in a relation to private methods of the class.
@@ -445,7 +445,7 @@ Please refer to the [Changelog][active-record] for detailed changes.
### Notable changes
-* Bump the minimum sqlite3 version to 1.4.
+* Bump the minimum version of the `sqlite3` gem to 1.4.
([Pull Request](https://github.com/rails/rails/pull/35844))
* Add `rails db:prepare` to create a database if it doesn't exist, and run its migrations.
@@ -577,7 +577,7 @@ Please refer to the [Changelog][active-record] for detailed changes.
* Allow the `:to_table` option of `remove_foreign_key` to be invertible.
([Pull Request](https://github.com/rails/rails/pull/33530))
-* Fix default value for mysql time types with specified precision.
+* Fix default value for MySQL time types with specified precision.
([Pull Request](https://github.com/rails/rails/pull/33280))
* Fix the `touch` option to behave consistently with `Persistence#touch` method.
@@ -762,7 +762,7 @@ Please refer to the [Changelog][active-support] for detailed changes.
([Pull Request](https://github.com/rails/rails/pull/34123))
* Deprecate `ActiveSupport::Multibyte::Unicode#normalize`
- and `ActiveSuppport::Multibyte::Chars#normalize` in favor of
+ and `ActiveSupport::Multibyte::Chars#normalize` in favor of
`String#unicode_normalize`.
([Pull Request](https://github.com/rails/rails/pull/34202))
@@ -771,7 +771,7 @@ Please refer to the [Changelog][active-support] for detailed changes.
([Pull Request](https://github.com/rails/rails/pull/34215))
* Deprecate `ActiveSupport::Multibyte::Unicode#pack_graphemes(array)`
- and `ActiveSuppport::Multibyte::Unicode#unpack_graphemes(string)`
+ and `ActiveSupport::Multibyte::Unicode#unpack_graphemes(string)`
in favor of `array.flatten.pack("U*")` and `string.scan(/\X/).map(&:codepoints)`,
respectively.
([Pull Request](https://github.com/rails/rails/pull/34254))
diff --git a/guides/source/configuring.md b/guides/source/configuring.md
index 3adc956ef9..407695ef8a 100644
--- a/guides/source/configuring.md
+++ b/guides/source/configuring.md
@@ -383,6 +383,12 @@ All these configuration options are delegated to the `I18n` library.
having to send a query to the database to get this information.
Defaults to `true`.
+* `config.active_record.collection_cache_versioning` enables the same cache key
+ to be reused when the object being cached of type `ActiveRecord::Relation`
+ changes by moving the volatile information (max updated at and count) of
+ the relation's cache key into the cache version to support recycling cache key.
+ Defaults to `false`.
+
The MySQL adapter adds one additional configuration option:
* `ActiveRecord::ConnectionAdapters::Mysql2Adapter.emulate_booleans` controls whether Active Record will consider all `tinyint(1)` columns as booleans. Defaults to `true`.
@@ -886,12 +892,14 @@ text/javascript image/svg+xml application/postscript application/x-shockwave-fla
#### With '6.0':
+- `config.autoloader`: `:zeitwerk`
- `config.action_view.default_enforce_utf8`: `false`
- `config.action_dispatch.use_cookies_with_metadata`: `true`
- `config.action_mailer.delivery_job`: `"ActionMailer::MailDeliveryJob"`
- `config.active_job.return_false_on_aborted_enqueue`: `true`
- `config.active_storage.queues.analysis`: `:active_storage_analysis`
- `config.active_storage.queues.purge`: `:active_storage_purge`
+- `config.active_record.collection_cache_versioning`: `true`
### Configuring a Database
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md
index 7000fa408c..e8b224a1a3 100644
--- a/guides/source/getting_started.md
+++ b/guides/source/getting_started.md
@@ -207,7 +207,7 @@ folder directly to the Ruby interpreter e.g. `ruby bin\rails server`.
TIP: JavaScript asset compression requires you
have a JavaScript runtime available on your system, in the absence
-of a runtime you will see an `execjs` error during asset compilation.
+of a runtime you will see an `execjs` error during asset compression.
Usually macOS and Windows come with a JavaScript runtime installed.
`therubyrhino` is the recommended runtime for JRuby users and is added by
default to the `Gemfile` in apps generated under JRuby. You can investigate
diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md
index 290aabc6f9..10a9f24c9a 100644
--- a/guides/source/upgrading_ruby_on_rails.md
+++ b/guides/source/upgrading_ruby_on_rails.md
@@ -85,13 +85,14 @@ Rails 6.1. You are encouraged to enable `config.force_ssl` to enforce HTTPS
connections throughout your application. If you need to exempt certain endpoints
from redirection, you can use `config.ssl_options` to configure that behavior.
-### Purpose in signed or encrypted cookie is now embedded within cookies
+### Purpose and expiry metadata is now embedded inside signed and encrypted cookies for increased security
+
+To improve security, Rails embeds the purpose and expiry metadata inside encrypted or signed cookies value.
-To improve security, Rails embeds the purpose information in encrypted or signed cookies value.
Rails can then thwart attacks that attempt to copy the signed/encrypted value
of a cookie and use it as the value of another cookie.
-This new embed information make those cookies incompatible with versions of Rails older than 6.0.
+This new embed metadata make those cookies incompatible with versions of Rails older than 6.0.
If you require your cookies to be read by Rails 5.2 and older, or you are still validating your 6.0 deploy and want
to be able to rollback set
@@ -281,6 +282,35 @@ won't work, child objects like `Hotel::Pricing` won't be found.
This restriction only applies to explicit namespaces. Classes and modules not defining a namespace can be defined using those idioms.
+#### One file, one constant (at the same top-level)
+
+In `classic` mode you could technically define several constants at the same top-level and have them all reloaded. For example, given
+
+```ruby
+# app/models/foo.rb
+
+class Foo
+end
+
+class Bar
+end
+```
+
+while `Bar` could not be autoloaded, autoloading `Foo` would mark `Bar` as autoloaded too. This is not the case in `zeitwerk` mode, you need to move `Bar` to its own file `bar.rb`. One file, one constant.
+
+This affects only to constants at the same top-level as in the example above. Inner classes and modules are fine. For example, consider
+
+```ruby
+# app/models/foo.rb
+
+class Foo
+ class InnerClass
+ end
+end
+```
+
+If the application reloads `Foo`, it will reload `Foo::InnerClass` too.
+
#### Spring and the `test` Environment
Spring reloads the application code if something changes. In the `test` environment you need to enable reloading for that to work:
@@ -319,7 +349,7 @@ By opting-out you optimize `$LOAD_PATH` lookups (less directories to check), and
#### Thread-safety
-In classic mode constant autoloading is not thread-safe, though Rails has locks in place for example to make web requests thread-safe when autoloading is enabled, as it is common in `development` mode.
+In classic mode, constant autoloading is not thread-safe, though Rails has locks in place for example to make web requests thread-safe when autoloading is enabled, as it is common in `development` mode.
Constant autoloading is thread-safe in `zeitwerk` mode. For example, you can now autoload in multi-threaded scripts executed by the `runner` command.
@@ -1774,7 +1804,7 @@ config.assets.enabled = true
config.assets.version = '1.0'
```
-If your application is using an "/assets" route for a resource you may want change the prefix used for assets to avoid conflicts:
+If your application is using an "/assets" route for a resource you may want to change the prefix used for assets to avoid conflicts:
```ruby
# Defaults to '/assets'