Merge pull request #16319 from Domon/fix-each-validator-example

Fix example code of EachValidator [ci skip]
Merge pull request #16148 from rails/fix_json_autoload

Fix json autoload
Conflicts:
	activesupport/CHANGELOG.md
Fixed CHANGELOG formating [ci skip]
Merge pull request #16328 from noinkling/template_password_confirmation_fix

Give password_confirmation div the "field" class in the scaffold generator "_form" partial

Conflicts:
	railties/CHANGELOG.md
docs, cleanup mixed indents within `form_options_helper.rb` RDoc.

[ci skip]

This fixes the broken code block rendering and indents the examples
within the parameter list.
Raise an exception when attachments are added after `mail` was called.

Closes #16163

Adding attachments after a call to `mail` will result in invalid emails.
This is related to the fact, that `mail` is making the required preparations
before the email is ready to be sent. These change depending on your
added attachments.

Conflicts:
	actionmailer/CHANGELOG.md
Regenerate sid when sbdy tries to fixate the session

Fixed broken test.

Thanks Stephen Richards for reporting.
Fix DateTime comparison with DateTime::Infinity object

Fixes #16406

Conflicts:
	activesupport/CHANGELOG.md
Merge pull request #16402 from bogdan/select_with_empty_block

Fixed #select form builder helper to support block without html output
Define id_was to get the previous value of the primary key

Currently when we call id_was and we have a custom primary key name
Active Record will return the current value of the primary key. This
make impossible to correctly do an update operation if you change the
id.

Fixes #16413

Conflicts:
	activerecord/CHANGELOG.md
Fix undefined method to_query for Hash

When cherry-picking `active_support/core_ext/object/to_param` in 4.1.*,
we still see an undefined method to_query for hash unless we also pull
in `.../to_query`.

This was resolved on master in c420a8da, so this is exclusively a
backport of "Move to_param to to_query, also Improve tests" based on the
Active Support Core Extensions guide's [Cherry-picking a Definition]
section.

[Cherry-picking a Definition]: http://guides.rubyonrails.org/active_support_core_extensions.html#cherry-picking-a-definition
Merge pull request #16411 from calebthompson/backport-param-changes

Fix undefined method to_query for Hash
[ci skip] Mention the change in nil handling for serialized attributes
in "Upgrading from Rails 3.2 to Rails 4.0"
Fix regression on after_commit in nested transactions.

after_commit should not run in nested transactions, however they should
run once the outermost transaction gets committed. This patch fixes the
problem copying the records from the Savepoint to its parent. So the
RealTransaction will have all records that needs to run callbacks on it.

[fixes #16425]
Merge pull request #16432 from arthurnn/after_commit_run_on_top_level_trans

Fix regression on after_commit in nested transactions.