aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
Diffstat (limited to 'guides')
-rw-r--r--guides/source/6_0_release_notes.md2
-rw-r--r--guides/source/active_record_multiple_databases.md2
-rw-r--r--guides/source/configuring.md7
-rw-r--r--guides/source/contributing_to_ruby_on_rails.md2
-rw-r--r--guides/source/getting_started.md2
-rw-r--r--guides/source/initialization.md6
-rw-r--r--guides/source/security.md2
-rw-r--r--guides/source/upgrading_ruby_on_rails.md16
8 files changed, 32 insertions, 7 deletions
diff --git a/guides/source/6_0_release_notes.md b/guides/source/6_0_release_notes.md
index c826b19f1a..c152076628 100644
--- a/guides/source/6_0_release_notes.md
+++ b/guides/source/6_0_release_notes.md
@@ -513,7 +513,7 @@ Please refer to the [Changelog][active-record] for detailed changes.
([Pull Request](https://github.com/rails/rails/pull/34742))
* Add the ability to disable scopes generated by `ActiveRecord.enum`.
- ([Pull Request](https://github.com/rails/rails/pull/34605/files))
+ ([Pull Request](https://github.com/rails/rails/pull/34605))
* Make implicit ordering configurable for a column.
([Pull Request](https://github.com/rails/rails/pull/34480))
diff --git a/guides/source/active_record_multiple_databases.md b/guides/source/active_record_multiple_databases.md
index d7d9bd1ca9..07be21a254 100644
--- a/guides/source/active_record_multiple_databases.md
+++ b/guides/source/active_record_multiple_databases.md
@@ -180,7 +180,7 @@ to primary based on the HTTP verb and whether there was a recent write.
If the application is receiving a POST, PUT, DELETE, or PATCH request the application will
automatically write to the primary. For the specified time after the write the application
-will read from the replica. For a GET or HEAD request the application will read from the
+will read from the primary. For a GET or HEAD request the application will read from the
replica unless there was a recent write.
To activate the automatic connection switching middleware, add or uncomment the following
diff --git a/guides/source/configuring.md b/guides/source/configuring.md
index b0bfe72741..e53e8b4e92 100644
--- a/guides/source/configuring.md
+++ b/guides/source/configuring.md
@@ -553,6 +553,10 @@ Defaults to `'signed cookie'`.
Any exceptions that are not configured will be mapped to 500 Internal Server Error.
+* `config.action_dispatch.return_only_media_type_on_content_type` change the
+ return value of `ActionDispatch::Response#content_type` to the Content-Type
+ header without modification. Defaults to `false`.
+
* `ActionDispatch::Callbacks.before` takes a block of code to run before the request.
* `ActionDispatch::Callbacks.after` takes a block of code to run after the request.
@@ -908,6 +912,7 @@ text/javascript image/svg+xml application/postscript application/x-shockwave-fla
- `config.autoloader`: `:zeitwerk`
- `config.action_view.default_enforce_utf8`: `false`
- `config.action_dispatch.use_cookies_with_metadata`: `true`
+- `config.action_dispatch.return_only_media_type_on_content_type`: `false`
- `config.action_mailer.delivery_job`: `"ActionMailer::MailDeliveryJob"`
- `config.active_job.return_false_on_aborted_enqueue`: `true`
- `config.active_storage.queues.analysis`: `:active_storage_analysis`
@@ -1536,7 +1541,7 @@ Disallow: /
```
To block just specific pages, it's necessary to use a more complex syntax. Learn
-it on the [official documentation](http://www.robotstxt.org/robotstxt.html).
+it on the [official documentation](https://www.robotstxt.org/robotstxt.html).
Evented File System Monitor
---------------------------
diff --git a/guides/source/contributing_to_ruby_on_rails.md b/guides/source/contributing_to_ruby_on_rails.md
index d3706a4dbf..9c28ff6a9c 100644
--- a/guides/source/contributing_to_ruby_on_rails.md
+++ b/guides/source/contributing_to_ruby_on_rails.md
@@ -139,7 +139,7 @@ changes to the master branch.
When working with documentation, please take into account the [API Documentation Guidelines](api_documentation_guidelines.html) and the [Ruby on Rails Guides Guidelines](ruby_on_rails_guides_guidelines.html).
-NOTE: To help our CI servers you should add [ci skip] to your documentation commit message to skip build on that commit. Please remember to use it for commits containing only documentation changes.
+NOTE: For documentation changes, your commit message should include [ci skip]. This will skip running the test suite, helping us to cut down on our server costs. Keep in mind that you should only skip CI when your change touches documentation exclusively.
Translating Rails Guides
------------------------
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md
index 64f4a3b6b3..ce45dbb2a7 100644
--- a/guides/source/getting_started.md
+++ b/guides/source/getting_started.md
@@ -28,7 +28,7 @@ curve diving straight into Rails. There are several curated lists of online reso
for learning Ruby:
* [Official Ruby Programming Language website](https://www.ruby-lang.org/en/documentation/)
-* [List of Free Programming Books](https://github.com/vhf/free-programming-books/blob/master/free-programming-books.md#ruby)
+* [List of Free Programming Books](https://github.com/EbookFoundation/free-programming-books/blob/master/free-programming-books.md#ruby)
Be aware that some resources, while still excellent, cover versions of Ruby as old as
1.6, and commonly 1.8, and will not include some syntax that you will see in day-to-day
diff --git a/guides/source/initialization.md b/guides/source/initialization.md
index 817c6b17bc..556c85cc0f 100644
--- a/guides/source/initialization.md
+++ b/guides/source/initialization.md
@@ -108,6 +108,8 @@ A standard Rails application depends on several gems, specifically:
* activerecord
* activestorage
* activesupport
+* actionmailbox
+* actiontext
* arel
* builder
* bundler
@@ -289,7 +291,7 @@ def default_options
environment: (ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development").dup,
daemonize: false,
caching: nil,
- pid: Options::DEFAULT_PID_PATH,
+ pid: ENV.fetch("PIDFILE", Options::DEFAULT_PIDFILE).dup,
restart_cmd: restart_command)
end
```
@@ -538,6 +540,8 @@ require "rails"
action_mailer/railtie
active_job/railtie
action_cable/engine
+ action_mailbox/engine
+ action_text/engine
rails/test_unit/railtie
sprockets/railtie
).each do |railtie|
diff --git a/guides/source/security.md b/guides/source/security.md
index 22c122d4b9..5bb7a51524 100644
--- a/guides/source/security.md
+++ b/guides/source/security.md
@@ -1211,4 +1211,4 @@ The security landscape shifts and it is important to keep up to date, because mi
* Subscribe to the Rails security [mailing list](https://groups.google.com/forum/#!forum/rubyonrails-security).
* [Brakeman - Rails Security Scanner](https://brakemanscanner.org/) - To perform static security analysis for Rails applications.
* [Keep up to date on the other application layers](http://secunia.com/) (they have a weekly newsletter, too).
-* A [good security blog](https://www.owasp.org) including the [Cross-Site scripting Cheat Sheet](https://www.owasp.org/index.php/DOM_based_XSS_Prevention_Cheat_Sheet).
+* A [good security blog](https://www.owasp.org) including the [Cross-Site scripting Cheat Sheet](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.md).
diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md
index 54f014293d..4192063e9b 100644
--- a/guides/source/upgrading_ruby_on_rails.md
+++ b/guides/source/upgrading_ruby_on_rails.md
@@ -270,6 +270,16 @@ In that case, `app/models/concerns` is assumed to be a root directory (because i
The `Concerns::` namespace worked with the classic autoloader as a side-effect of the implementation, but it was not really an intended behavior. An application using `Concerns::` needs to rename those classes and modules to be able to run in `zeitwerk` mode.
+#### Having `app` in the autoload paths
+
+Some projects want something like `app/api/base.rb` to define `API::Base`, and add `app` to the autoload paths to accomplish that in `classic` mode. Since Rails adds all subdirectories of `app` to the autoload paths automatically, we have another situation in which there are nested root directories, so that setup no longer works. Similar principle we explained above with `concerns`.
+
+If you want to keep that structure, you'll need to delete the subdirectory from the autoload paths in an initializer:
+
+```ruby
+ActiveSupport::Dependencies.autoload_paths.delete("#{Rails.root}/app/api")
+```
+
#### Autoloaded Constants and Explicit Namespaces
If a namespace is defined in a file, as `Hotel` is here:
@@ -391,6 +401,12 @@ To fix this, just remove the wildcards:
config.autoload_paths << "#{config.root}/lib"
```
+#### Eager loading and autoloading are consistent
+
+In `classic` mode, if `app/models/foo.rb` defines `Bar`, you won't be able to autoload that file, but eager loading will work because it loads files recursively blindly. This can be a source of errors if you test things first eager loading, execution may fail later autoloading.
+
+In `zeitwerk` mode both loading modes are consistent, they fail and err in the same files.
+
#### How to Use the Classic Autoloader in Rails 6
Applications can load Rails 6 defaults and still use the classic autoloader by setting `config.autoloader` this way: