Merge pull request #11496 from jetthoughts/11376_has_many_assoc_respect_scope_on_build

Removed where_values_hash from AR::NullRelation
Conflicts:
	activerecord/CHANGELOG.md
Replace global Hash with TS::Cache.

Conflicts:
	actionpack/lib/action_dispatch/journey/visitors.rb
Make GTG::TransTable thread safe.

From now on only the `[]=` method is allowed to modify the internal states hashes.
Merge pull request #12354 from kennyj/fix_12293

Closes #12293. Strong parameters should permit nested number as key.
Conflicts:
	actionpack/CHANGELOG.md
Merge pull request #12400 from jaredbeck/fixes_guide_re_action_on_unpermitted_parameters

Fixes incorrect spelling of `action_on_unpermitted_parameters` in guide
Merge pull request #12383 from marclennox/master

Fixed issue #12327
Conflicts:
	activerecord/test/cases/base_test.rb
make sure both headers are set before checking for ip spoofing
(cherry picked from commit ccd6f8b931efa7b3eb191a62522fbfc89389b091)

Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
Revert "Merge pull request #10710 from senny/5554_let_the_database_raise_on_counts"

This reverts commit b8e29789bc46362a42d996b2d941524b47a802a2.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation/calculations.rb

Reason: This change is not backward compatible and it was reverted
before 4.0.0 at 2ad168ee41d590bd9a4d15eddf3c2f719c23b60a so we can't include in 4-0-stable.

Closes #12417
Merge pull request #12416 from sepastian/guides_configuring_initialization_hooks

guides: configuring: fixing explanation of :after_initialize hook [ci skip]
Merge pull request #12418 from makaroni4/fix/ar_reload_doc_12101

Update AR reload doc for the case of manually set primary key attribute [ci skip]
Adds the Rails maintenance policy to the Guides

[ci skip]

Conflicts:
	guides/CHANGELOG.md
copy-edits the new guide with our maintenance policy [ci skip]
Merge pull request #12430 from vipulnsward/changelog_fix

`intiantiated` => `instantiated` [ci skip]
Merge pull request #12431 from GRoguelon/master

Fix a typo in the code of Testing guide. [ci skip]
Port test from cf1904f to avoid future regression

Related issue: #11939, #12084
Merge pull request #12436 from sikachu/4-0-stable-port-12084

Port test from cf1904f to avoid future regression