The original contained a long sentence that was a bit awkward. This
shortens the sentence and adds the `create` method as a method that
calls validations.
As `GROUP BY` is the actual clause and not `GROUP`, we could rename the
`Group` heading to `Group By`. But as other headings (Ordering, Selecting,
Joining) describe the usage instead of the SQL statement, it has been
renamed to it's usage: `Grouping`.
The `HAVING` condition requires a `GROUP BY` condition, so it's moved
under the `Grouping` section. The heading has been renamed similar to
other headings like `NOT conditions.
Sidekiq::MAJOR was added in mperham/sidekiq@b4092e3, which is only
included in 7.0.0+ so we can't use it to check the version for
Sidekiq 6.
Since the test code is written to support both, the condition should
also support both.
This was broken in 0019dea and partially fixed for setting config.hosts
to a nil value in 56ecea0.
However, since HostAuthorization coerces the hosts param to an array to
allow a single String or IPAddr as a valid value, the check should do
the same.
Prior to #46858, uses can set `config.hosts = nil` to allow all hosts.
But now it causes `NoMethodError` because the check uses only `empty?`.
Given that the HostAuthorization itself allows taking `nil` as hosts,
I think this breaking change is not intentional. Therefore this commit
fixes the issue by also checking if the value is `nil`.
The Action Controller Overview guide has a small section about rendering
XML and JSON data, but it doesn't mention HTML rendering or where you
can learn more about rendering.
By making the heading more generic ("Rendering", similar to other
sections like "Cookies", "Parameters", etc) and linking to the Layouts
and Rendering guide, we hopefully make it easier to find information
about rendering.
Templates, Partials and Layouts deserve their own sections.
All headings of these section can now be moved a level up, making these
headings show up in the sidebar section. This improves the overview of
what is described in the guide.
Partial Layouts, which already had their own section, is now moved under
the Layouts section, as it is part of the layouts.
The other Active Record guides are mentioned in the Basics guide as
well, so it makes sense to also shortly mention the associations and
where to find out more about them.
This replaces two instances of /html/.match?(<string>) with the more
performant <string>.include?("html").
Performance/StringInclude was enabled in 3158bbb, however RuboCop does
not flag these two because it is unable to determine that the variable
passed to #match? is a string. In both these cases we know that the
variable must be a string (Mime::Type must be initialized with a string,
and Content-Type must be a string if present per Rack SPEC)
These were found by `rg '/\[\w ]+/\.match\?'`, and while this search
returns other entries they are either comments or in test files.
The "learn more" content is a separate subject that seems unrelated to
the previous paragraph. Moving these all to a separate paragraph also
makes the guide more consistent.
Unless you're very good at math, this test fail message is not the easiest to debug:
```
"User.count" didn't change by 32.
Expected: 1611
Actual: 1579
```
It's not obvious from the error, but in this case, it actually changed by 0. This is a pretty strong clue as to what went wrong, but the message doesn't tell us that.
This PR improves the message to make debugging easier:
```
"User.count" didn't change by 32 (changed by 0).
Expected: 1611
Actual: 1579
```