Backport relation merger updates from 9675c7d to 4-0-stable

Fixes #10995.
Merge pull request #12813 from gaurish/patch-2

fix broken url/formatting in Asset pipeline guide [ci skip]
Conflicts:
	guides/source/asset_pipeline.md
Merge pull request #12760 from pseidemann/master

fix simple_format escapes own output when sanitize is set to true
Conflicts:

	actionpack/lib/action_view/helpers/text_helper.rb
	actionview/CHANGELOG.md
Merge pull request #12821 from arunagw/aa-removed-missleading-message

clarified missleading message
Correct `as_json` return example to display miliseconds

As of 28ab79d7 TimeWithZone#as_json returns 3 decimal places of
sub-second accuracy. This just updates the example on the api docs
reflect that change.
Improve wording in AC::ParameterMissing error message
Merge pull request #12825 from huoxito/update-as_json-example

Correct `as_json` return example to display miliseconds
Fixed minor typo

instead of 'rake test' as shortcut, use 'rake'.

Closes #12780 [ci skip]
Use arel 4-0-stable branch
Merge pull request #12749 from iantropov/issue_5303

Add test for ActiveRecord::Relation YAML serialization, for #5303 issue
Merge pull request #12740 from gaurish/patch-1

Improve Errors when Controller Name or Action isn't specfied
Merge pull request #12834 from dredozubov/has_one_association_replacement

Fixes problem with replacing has_one association record with itself
Conflicts:
	activerecord/CHANGELOG.md
tidy Active Record CHANGELOG. [ci skip].
Fixed typo in migrations guide [ci skip]
Update security.md [ci skip]
updated documentation for Integer [ci skip]
Merge pull request #12748 from dm1try/fix_counter_cache_for_through_association

Fixes #11079, prevent the counter cache from being decremented twice when destroying a record on a has_many :through association
Conflicts:
	activerecord/CHANGELOG.md
`remove_column` does not take a type argument. [ci skip]. Closes #12864
Revert "`remove_column` does not take a type argument. [ci skip]. Closes #12864"

As of Rails 4.0 `remove_column` is no longer an alias for `remove_columns`.
The type is actually valid and used when issuing a rollback (new `change` method).

This reverts commit 6a5e3647a8bfdca7ece7db30508a8b5db9709426.
Merge pull request #12870 from sauliusg/atom-feed-doc-fix

Fix syntax error in atom_feed example [ci skip]