Add an after_bundle callback in Rails templates

The template runs before the generation of binstubs – this does not
allow to write one, that makes an initial commit to version control.
It is solvable by adding an after_bundle callback.
Fixed #select form builder helper to support block with html output
Add after_bundle to the release notes and upgrade guide
Revert "Revert "Merge pull request #15394 from morgoth/fix-automatic-maintaining-test-schema-for-sql-format""

This reverts commit 5c87b5c5248154cf8aa76cce9a24a88769de022d.
schema rake tasks are specific about the configuration to act on.

The rake tasks and the `DatabaseTakss` adapter classes used to
assume a configuration at some places. This forced the rake
tasks to establish a specific connection before calling into
`load_schema`.

After #15394 this started to cause issues because it could
`purge` the wrong database before loading the schema.
Merge pull request #16316 from rails/senny/purge_schema_maintenance

purge database before loading schema, take 2
Merge pull request #16359 from skanev/after-bundle-in-rails-templates

Add an after_bundle callback in Rails templates

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

Fixed #select form builder helper to support block without html output
defined? should actually work in current implementation

So this trick is not needed to be documented anymore.
Allow password to contain spaces only.
refactor Redirecting so we do not need a controller instance
lazily instantiate application subclasses

this means we can meaningfully override methods in the subclass
Fix DateTime comparison with DateTime::Infinity object

Fixes #16406
Test using turbolinks master

See
https://github.com/rails/turbolinks/commit/153f1b0f04c718442cfd73365a2778dfe1a1c5c7
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
Remove ActionController::RaiseActionExceptions.

The latest modification to the code was done in https://github.com/rails/rails/commit/5e3517ea. In Rails 3.2,
`ActionController#rescue_action` was deprecated and `rescue_action_without_handler` is no longer being used.
Merge pull request #16419 from tgxworld/remove_legacy_code

Remove ActionController::RaiseActionExceptions.
Merge pull request #16412 from yevhene/master

Fix in has_secure_password for passwords containing only spaces.
Fix typo [ci skip]
Tables existence check query is executed in large quantities

When Rails starts, tables existence check query is executed
number of models.
In case of mysql,

    SHOW TABLES LIKE 'table1';
    SHOW TABLES LIKE 'table2';
    SHOW TABLES LIKE 'table3';
    ...
    SHOW TABLES LIKE 'table999';

Add process to get the names of all tables by one query.