aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/5_2_release_notes.md40
-rw-r--r--guides/source/active_storage_overview.md35
-rw-r--r--guides/source/association_basics.md19
-rw-r--r--guides/source/configuring.md4
-rw-r--r--guides/source/engines.md12
-rw-r--r--guides/source/testing.md2
-rw-r--r--guides/source/upgrading_ruby_on_rails.md2
7 files changed, 64 insertions, 50 deletions
diff --git a/guides/source/5_2_release_notes.md b/guides/source/5_2_release_notes.md
index e2f8cf1f76..7b5c4b87e3 100644
--- a/guides/source/5_2_release_notes.md
+++ b/guides/source/5_2_release_notes.md
@@ -63,9 +63,20 @@ Railties
Please refer to the [Changelog][railties] for detailed changes.
-### Removals
+### Deprecations
-ToDo
+* Deprecate `capify!` method in generators and templates.
+ ([Pull Request](https://github.com/rails/rails/pull/29493))
+
+* Deprecated passing the environment's name as a regular argument to the
+ `rails dbconsole` and `rails console` commands.
+ ([Pull Request](https://github.com/rails/rails/pull/29358))
+
+* Deprecated using subclass of `Rails::Application` to start the Rails server.
+ ([Pull Request](https://github.com/rails/rails/pull/30127))
+
+* Deprecated `after_bundle` callback in Rails plugin templates.
+ ([Pull Request](https://github.com/rails/rails/pull/29446))
### Notable changes
@@ -76,9 +87,18 @@ Action Cable
Please refer to the [Changelog][action-cable] for detailed changes.
+### Removals
+
+* Removed deprecated evented redis adapter.
+ ([Commit](https://github.com/rails/rails/commit/48766e32d31))
+
### Notable changes
-ToDo
+* Added support for `host`, `port`, `db` and `password` options in cable.yml
+ ([Pull Request](https://github.com/rails/rails/pull/29528))
+
+* Added support for compatibility with redis-rb gem for 4.0 version.
+ ([Pull Request](https://github.com/rails/rails/pull/30748))
Action Pack
-----------
@@ -87,11 +107,14 @@ Please refer to the [Changelog][action-pack] for detailed changes.
### Removals
-ToDo
+* Removed deprecated `ActionController::ParamsParser::ParseError`.
+ ([Commit](https://github.com/rails/rails/commit/e16c765ac6d))
### Deprecations
-ToDo
+* Deprecated `#success?`, `#missing?` and `#error?` aliases of
+ `ActionDispatch::TestResponse`.
+ ([Pull Request](https://github.com/rails/rails/pull/30104))
### Notable changes
@@ -104,11 +127,14 @@ Please refer to the [Changelog][action-view] for detailed changes.
### Removals
-ToDo
+* Removed deprecated Erubis ERB handler.
+ ([Commit](https://github.com/rails/rails/commit/7de7f12fd14))
### Deprecations
-ToDo
+* Deprecated `image_alt` helper which used to add default alt text to
+ the images generated by `image_tag`.
+ ([Pull Request](https://github.com/rails/rails/pull/30213))
### Notable changes
diff --git a/guides/source/active_storage_overview.md b/guides/source/active_storage_overview.md
index 01384e014e..f45dbdee3e 100644
--- a/guides/source/active_storage_overview.md
+++ b/guides/source/active_storage_overview.md
@@ -41,9 +41,6 @@ application to Rails 5.2, run `rails active_storage:install` to generate a
migration that creates these tables. Use `rails db:migrate` to run the
migration.
-You need not run `rails active_storage:install` in a new Rails 5.2 application:
-the migration is generated automatically.
-
Declare Active Storage services in `config/storage.yml`. For each service your
application uses, provide a name and the requisite configuration. The example
below declares three services named `local`, `test`, and `amazon`:
@@ -206,8 +203,8 @@ production:
NOTE: Files are served from the primary service.
-Attach Files to a Model
------------------------
+Attaching Files to Records
+--------------------------
### `has_one_attached`
@@ -294,8 +291,8 @@ Call `images.attached?` to determine whether a particular message has any images
@message.images.attached?
```
-Remove File Attached to Model
------------------------------
+Removing Files
+--------------
To remove an attachment from a model, call `purge` on the attachment. Removal
can be done in the background if your application is setup to use Active Job.
@@ -309,8 +306,8 @@ user.avatar.purge
user.avatar.purge_later
```
-Link to Attachments
--------------------
+Linking to Files
+----------------
Generate a permanent URL for the blob that points to the application. Upon
access, a redirect to the actual service endpoint is returned. This indirection
@@ -329,8 +326,8 @@ helper allows you to set the disposition.
rails_blob_path(user.avatar, disposition: "attachment")
```
-Transform Images
-----------------
+Transforming Images
+-------------------
To create variation of the image, call `variant` on the Blob.
You can pass any [MiniMagick](https://github.com/minimagick/minimagick)
@@ -350,8 +347,8 @@ location.
<%= image_tag user.avatar.variant(resize: "100x100") %>
```
-Preview Non-image Files
------------------------
+Previewing Files
+----------------
Some non-image files can be previewed: that is, they can be presented as images.
For example, a video file can be previewed by extracting its first frame. Out of
@@ -373,8 +370,8 @@ install them yourself to use the built-in previewers. Before you install and use
third-party software, make sure you understand the licensing implications of
doing so.
-Upload Directly to Service
---------------------------
+Direct Uploads
+--------------
Active Storage, with its included JavaScript library, supports uploading
directly from the client to the cloud.
@@ -511,8 +508,8 @@ input[type=file][data-direct-upload-url][disabled] {
}
```
-Clean up Stored Files Store During System Tests
------------------------------------------------
+Discarding Files Stored During System Tests
+-------------------------------------------
System tests clean up test data by rolling back a transaction. Because destroy
is never called on an object, the attached files are never cleaned up. If you
@@ -550,8 +547,8 @@ config.active_job.queue_adapter = :inline
config.active_storage.service = :local_test
```
-Support Additional Cloud Services
----------------------------------
+Implementing Support for Other Cloud Services
+---------------------------------------------
If you need to support a cloud service other than these, you will need to
implement the Service. Each service extends
diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md
index b5e236b790..02d012d702 100644
--- a/guides/source/association_basics.md
+++ b/guides/source/association_basics.md
@@ -735,12 +735,9 @@ a.first_name = 'David'
a.first_name == b.author.first_name # => true
```
-Active Record supports automatic identification for most associations with standard names. However, Active Record will not automatically identify bi-directional associations that contain any of the following options:
+Active Record supports automatic identification for most associations with standard names. However, Active Record will not automatically identify bi-directional associations that contain a scope or any of the following options:
-* `:conditions`
* `:through`
-* `:polymorphic`
-* `:class_name`
* `:foreign_key`
For example, consider the following model declarations:
@@ -787,12 +784,6 @@ a.first_name = 'David'
a.first_name == b.writer.first_name # => true
```
-There are a few limitations to `:inverse_of` support:
-
-* They do not work with `:through` associations.
-* They do not work with `:polymorphic` associations.
-* They do not work with `:as` associations.
-
Detailed Association Reference
------------------------------
@@ -1012,7 +1003,7 @@ When we execute `@user.todos.create` then the `@todo` record will have its
##### `:inverse_of`
-The `:inverse_of` option specifies the name of the `has_many` or `has_one` association that is the inverse of this association. Does not work in combination with the `:polymorphic` options.
+The `:inverse_of` option specifies the name of the `has_many` or `has_one` association that is the inverse of this association.
```ruby
class Author < ApplicationRecord
@@ -1082,7 +1073,7 @@ You can use any of the standard [querying methods](active_record_querying.html)
The `where` method lets you specify the conditions that the associated object must meet.
```ruby
-class book < ApplicationRecord
+class Book < ApplicationRecord
belongs_to :author, -> { where active: true }
end
```
@@ -1299,7 +1290,7 @@ TIP: In any case, Rails will not create foreign key columns for you. You need to
##### `:inverse_of`
-The `:inverse_of` option specifies the name of the `belongs_to` association that is the inverse of this association. Does not work in combination with the `:through` or `:as` options.
+The `:inverse_of` option specifies the name of the `belongs_to` association that is the inverse of this association.
```ruby
class Supplier < ApplicationRecord
@@ -1694,7 +1685,7 @@ TIP: In any case, Rails will not create foreign key columns for you. You need to
##### `:inverse_of`
-The `:inverse_of` option specifies the name of the `belongs_to` association that is the inverse of this association. Does not work in combination with the `:through` or `:as` options.
+The `:inverse_of` option specifies the name of the `belongs_to` association that is the inverse of this association.
```ruby
class Author < ApplicationRecord
diff --git a/guides/source/configuring.md b/guides/source/configuring.md
index b1e472bb74..1668f9e81a 100644
--- a/guides/source/configuring.md
+++ b/guides/source/configuring.md
@@ -66,8 +66,6 @@ These configuration methods are to be called on a `Rails::Railtie` object, such
* `config.cache_classes` controls whether or not application classes and modules should be reloaded on each request. Defaults to `false` in development mode, and `true` in test and production modes.
-* `config.action_view.cache_template_loading` controls whether or not templates should be reloaded on each request. Defaults to whatever is set for `config.cache_classes`.
-
* `config.beginning_of_week` sets the default beginning of week for the
application. Accepts a valid week day symbol (e.g. `:monday`).
@@ -538,6 +536,8 @@ Defaults to `'signed cookie'`.
`config.action_view` includes a small number of configuration settings:
+* `config.action_view.cache_template_loading` controls whether or not templates should be reloaded on each request. Defaults to whatever is set for `config.cache_classes`.
+
* `config.action_view.field_error_proc` provides an HTML generator for displaying errors that come from Active Model. The default is
```ruby
diff --git a/guides/source/engines.md b/guides/source/engines.md
index 33694cf76a..8d81296fa5 100644
--- a/guides/source/engines.md
+++ b/guides/source/engines.md
@@ -1516,12 +1516,12 @@ To hook into the initialization process of one of the following classes use the
These are the available configuration hooks. They do not hook into any particular framework, but instead they run in context of the entire application.
-| Hook | Use Case |
-| ---------------------- | ------------------------------------------------------------------------------------- |
-| `before_configuration` | First configurable block to run. Called before any initializers are run. |
-| `before_initialize` | Second configurable block to run. Called before frameworks initialize. |
-| `before_eager_load` | Third configurable block to run. Does not run if `config.cache_classes` set to false. |
-| `after_initialize` | Last configurable block to run. Called after frameworks initialize. |
+| Hook | Use Case |
+| ---------------------- | ---------------------------------------------------------------------------------- |
+| `before_configuration` | First configurable block to run. Called before any initializers are run. |
+| `before_initialize` | Second configurable block to run. Called before frameworks initialize. |
+| `before_eager_load` | Third configurable block to run. Does not run if `config.eager_load` set to false. |
+| `after_initialize` | Last configurable block to run. Called after frameworks initialize. |
### Example
diff --git a/guides/source/testing.md b/guides/source/testing.md
index bf310cf2db..b82ccebe7c 100644
--- a/guides/source/testing.md
+++ b/guides/source/testing.md
@@ -778,7 +778,7 @@ Then the test will fill in the title and body of the article with the specified
text. Once the fields are filled in, "Create Article" is clicked on which will
send a POST request to create the new article in the database.
-We will be redirected back to the the articles index page and there we assert
+We will be redirected back to the articles index page and there we assert
that the text from the new article's title is on the articles index page.
#### Taking it further
diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md
index bb4ef26876..33ab50b0e8 100644
--- a/guides/source/upgrading_ruby_on_rails.md
+++ b/guides/source/upgrading_ruby_on_rails.md
@@ -72,7 +72,7 @@ For more information on changes made to Rails 5.1 please see the [release notes]
### Top-level `HashWithIndifferentAccess` is soft-deprecated
-If your application uses the the top-level `HashWithIndifferentAccess` class, you
+If your application uses the top-level `HashWithIndifferentAccess` class, you
should slowly move your code to instead use `ActiveSupport::HashWithIndifferentAccess`.
It is only soft-deprecated, which means that your code will not break at the