Save has_one associations only if record has changes

Prevents save related callbacks such as `after_commit` being
triggered when `has_one` objects are already persisted and have no
changes.
Only use BINARY for mysql case sensitive uniqueness check when column has a case insensitive collation.
typos fixes
Tweak Configuring Guide language

the fact that Rails is multi-thread by default is not very relevant. see https://github.com/rails/rails/pull/13998 [ci skip]
:scissors:

This commit also addresses rails/docrails#169 and rails/rails#14159
Improve guide for Hash#transform_keys and related methods.

[skip ci]
Fix code alignment in duplicable? guide.

[skip ci]
Improve collision explanation for Hash#transform_keys.

Based on comments at
https://github.com/rails/docrails/commit/42417b0013819e573be9ffc5402e179003156e8e#commitcomment-5527251

[skip ci]
Replace map.flatten with flat_map in actionpack
Replace map.flatten with flat_map in activerecord
Replace map.flatten with flat_map in railties
Allow string hash values on AR order method

This behavior has almost no performance impact:

String not allowed  66.910000   0.030000  66.940000 ( 67.024976)
String allowed      69.360000   0.030000  69.390000 ( 69.503096)

Benchmarked with http://git.io/Y0YuRw.
Make CSRF failure logging optional/configurable.

Added the log_warning_on_csrf_failure option to ActionController::RequestForgeryProtection
which is on by default.
Merge pull request #14263 from robin850/allow_passing_string_to_order_hash

Follow up of #10732 - Allow string hash values on AR order method
quick pass over Active Record CHANGELOG. [ci skip].
docs, flash message keys are normalized to strings. [ci skip]

This is a follow up to a668beffd64106a1e1fedb71cc25eaaa11baf0c1
we only need to support `asc` and `ASC`. No need for mixed cases. #14263

This is a result of the discussion at https://github.com/rails/rails/pull/14263/files#r10291489
get rid of intermediate arrays.

origin: https://github.com/rails/rails/commit/f6aeb8b1a3687c8523e4a56309fe3736011b2935#commitcomment-5569649
Remove a reference to an issue [ci skip]

This actually not an issue fixing ; the changelog is referring to the
introducing pull request itself.
Do note remove `Content-Type` when `render :body`

`render :body` should just not set the `Content-Type` header. By
removing the header, it breaks the compatibility with other parts.

After this commit, `render :body` will returns `text/html` content type,
sets by default from `ActionDispatch::Response`, and it will preserve
the overridden content type if you override it.

Fixes #14197, #14238

This partially reverts commit 3047376870d4a7adc7ff15c3cb4852e073c8f1da.