Merge pull request #12621 from laurocaetano/fix_has_one_association_with_primary_key_set

Save association when primary key is manually set

Conflicts:
	activerecord/CHANGELOG.md
test to verify the `ActiveRecord::Store` behavior with PG's json type
`stored_attributes` need to be specific to a subclass.

Currently they are all stored globally in the same `Hash`.
This commit forces the creation of a per-class variable if necessary.

The behavior was exposed through the following test-case:

```
  1) Failure:
StoreTest#test_all_stored_attributes_are_returned [/Users/senny/Projects/rails/activerecord/test/cases/store_test.rb:151]:
--- expected
+++ actual
@@ -1 +1 @@
-[:color, :homepage, :favorite_food]
+[:resolution, :color, :homepage, :favorite_food]
```
`ActiveRecord::Store` works together with PG `hstore` columns.

This is necessary because as of 5ac2341 `hstore` columns are always stored
as `Hash` with `String` keys. `ActiveRecord::Store` expected the attribute to
be an instance of `HashWithIndifferentAccess`, which led to the bug.
Merge pull request #12490 from senny/store_accessor_hstore_bug

ActiveRecord Store works with PG `hstore` columns
Fix migration docs to use new remove_column  semantics

Fixes: #12640
Merge pull request #12641 from jetthoughts/12640_updated_migrations_doc_to_use_remove_column

Fix migration docs to use new remove_column  semantics
Improve usage example for model generator
Merge pull request #12642 from ka8725/fix_usage_for_model_generators

Improve usage example for model generator decimal field
prevent global timezone state from leaking out of test cases.
Merge pull request #12633 from senny/no_more_time_zone_leaks

prevent global timezone state from leaking out of test cases.
only warn on leaked time zone state instead of rasing an error.

Raising `RuntimeErrors` skips important cleanup code and leads to
a lot of subsequent errors. This clutters the test output with a lot
of noise.
prevent `time_zone_aware_attributes` test leak. follow-up to #12633.
cast json values on write to be consistent with reading from the db.

See also commit 5ac2341fab689344991b2a4817bd2bc8b3edac9d
Merge pull request #12643 from severin/pg_cast_json_on_write

cast json values on write to be consistent with reading from the db.
Fixed typo with after_commit docs

Fixed syntax error on `after_commit` docs
Merge pull request #12648 from chrisledet/patch-1

Fixed typo with after_commit docs
Remove surprise if from show_exception middleware

This increase the readability within the rescue block.
Merge pull request #12655 from rails/ps-remove-surprise-if-in-show-exception-middleware

Remove surprise if from show_exception middleware
don't mutate hash with fetch