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
Make CSRF failure logging optional/configurable.

Added the log_warning_on_csrf_failure option to ActionController::RequestForgeryProtection
which is on by default.
Update doc for TagHelper.
unscope doesn't remove only the default_scope, but all of them.

[ci-skip]
Closes rails/rails#14294
fix typo app -> all

Thank you @bquorning
Merge branch 'master' of github.com:rails/docrails

Conflicts:
	guides/source/4_1_release_notes.md
Fix OrderedHash.select to return self instance.

On ruby 2.1.1 the behavior of .select and .reject has changed.
They will return a Hash new instance, so we need to override them to
keep the instance object class.
Add preventDefault() on click event
Merge pull request #14316 from the4dpatrick/master

Add preventDefault() on click event
Make sure we clean preview_interceptors

We should make sure we clean preview_interceptors after each test so they dont leaky to the next test