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
added example of hash#except, and removed extra whitespaces [ci skip]
Merge pull request #17543 from rishijain/update_docs_9

added example of hash#except, and removed extra whitespaces [ci skip]
[Enh] Changed the visibility of the ActiveModel::Dirty#clear_attribute_changes method

In Rails 4.2 it is impossible to define a custom default value for a model's
attribute without making it appear as _changed?, especially when the model
is first initialized. Making this method publicly visible will allow such a behaviour,
without the need to use private APIs.
Merge pull request #17545 from marzapower/dirty_public_api

[Enh] Made the ActiveModel::Dirty#clear_attribute_changes method public
Print out a meaningful error when ActiveRecord::ReadOnlyRecord is raised

Currently, there is no messages which get printed out. Convoluted system
may have hooks that create other objects in which case we only fail with
no messages. This commit changes this information allowing you to know
which object is the one that actually raised the error.
Merge pull request #17541 from OpenSourceProjects/meaninful_message

Print out a meaningful error when ActiveRecord::ReadOnlyRecord is raised
[ci skip] modify default host in command line guide
Merge pull request #17551 from y-yagi/fix_command_line_guide

[ci skip] modify default host in command line guide
docs, the abstract data type `:timestamp` was removed. See #15184 [ci skip]
remove the last traces of OpenBase from our codebase. [ci skip]
pg tests, only execute what's necessary.
pg tests, get rid of `sql_types_test.rb`.
Guides: Corrected name for assigns key [ci skip]

- Integration test example is now using 'articles' name
  for both path and assigns key.
Merge pull request #17552 from jipe/master

Guides: Corrected name for assigns key [ci skip]
default scopes should break the cache on has_many.

if you specify a default scope on a model, it will break caching.  We
cannot predict what will happen inside the scope, so play it safe for
now.  fixes #17495
Merge pull request #17493 from petewest/duration-comparable

Delegate comparison operator to value