Fix that a collection proxy could be cached before the save of the owner, resulting in an invalid proxy lacking the owner’s id.

Absent this fix calls like: owner.association.update_all to behave unexpectedly because they try to act on association objects where
owner_id is null.

more evidence here: https://gist.github.com/Empact/5865555
```
Active Record 3.2.13
-- create_table(:firms, {:force=>true})
   -> 0.1371s
-- create_table(:clients, {:force=>true})
   -> 0.0005s
1 clients. 1 expected.
1 clients updated. 1 expected.
```

```
Active Record 4.0.0
-- create_table(:firms, {:force=>true})
   -> 0.1606s
-- create_table(:clients, {:force=>true})
   -> 0.0004s
1 clients. 1 expected.
0 clients updated. 1 expected.
```
Add a section about job testing [ci skip]

* Cover lower level job testing (assertions about the execution of the
  job itself).
* Add a table with the custom assertions provided by Active Job's
  `TestHelper` module.
* Add an example testing job queuing inside a model
`secret_token` is now saved in `Rails.application.secrets.secret_token`

- `secrets.secret_token` is now used in all places `config.secret_token` was
  - `secrets.secret_token`, when not present in `config/secrets.yml`,
    now falls back to the value of `config.secret_token`
  - when `secrets.secret_token` is set, it over-writes
    `config.secret_token` so they are the same (for backwards-compatibility)
  - Update docs to reference app.secrets in all places
    - Remove references to `config.secret_token`, `config.secret_key_base`
- Warn that missing secret_key_base is deprecated
- Add tests for secret_token, key_generator, and message_verifier
  - the legacy key generator is used with the message verifier when
    secrets.secret_key_base is blank and secret_token is set
  - app.key_generator raises when neither secrets.secret_key_base nor
    secret_token are set
  - app.env_config    raises when neither secrets.secret_key_base nor
    secret_token are set
- Add changelog

Run focused tests via
ruby -w -Itest test/application/configuration_test.rb -n '/secret_|key_/'
Delegate comparison operator to value
Remove session to allow `with_routing` to be called twice.

Fixes: https://github.com/rails/rails/issues/16814
Improve performance of AR object instantiation

We introduced a performance hit by adding an additional iteration
through a model's attributes on creation. We don't actually need the
values from `Result` to be a hash, we can separate the columns and
values and zip them up ourself during the iteration that we have to do.
Remove unneccesary default parameters
Removed documentation that still mentioned using respond_with in place
of respond_to. respond_with was moved into the responders gem and deprecated
inside rails, so there is no need to mention it within rails itself.
Merge pull request #17528 from revans/respond_with_doc

[docs] Removed respond_with documentation as it was deprecated and removed from Rails [ci-skip]
Remove redundancy

I love this guide! 
and "visually see" is redundant.
remove "visually", then the sentence reads:
> Action Mailer previews provide a way to see how emails look
Replace Html with HTML [ci skip]

- Everywhere else we using HTML Sanitizer except this place.
added example of squish!, remove, test case for multiple occurrence of
pattern removal

added example for string#remove and test case for remove of multiple occurence of pattern

removed extra whitespaces
Merge pull request #17530 from prathamesh-sonpatki/fix-html

Replace Html with HTML [ci skip]
Merge pull request #17529 from slothbear/patch-1

Remove redundancy [ci skip]
docs, synchronize 4.2. release notes. [ci skip]

/cc @chancancode
Merge pull request #17526 from rishijain/update_docs_6

Update docs 6
Fix grouped expression warning -  `warning: (...) interpreted as grouped expression`
Merge pull request #17536 from vipulnsward/fix-group-expression-warning

Fixed grouped expression warning
Merge pull request #17523 from tgxworld/reset_session_after_calling_with_routing

Remove session to allow `with_routing` to be called twice.
tests, use SchemaDumpingHelper to dump a specific table.

This makes debugging the generated schema output much easier.
As a side effect it also shaves off 2.5 seconds of test runtime.