Fix iterating over DateTime by doing strict checking for Time objects

- Fixes #13667

(cherry picked from commit 1842a6920f6205262407ca893d31577f050b6b87)
Add CHANGELOG entry for #13668
doc proc/lambda arg on inclusion validation. Closes #13689. [ci skip]
fix bug in becomes! when changing from base to subclass. Closes #13272.

Conflicts:
	activerecord/CHANGELOG.md
Only lookup `config.log_level` for stdlib `::Logger`. Closes #11665.

This prevents Rails from assigning meaningless log levels to third
party loggers like log4r. If `Rails.logger` is not `kind_of?(::Logger)`
we simply assign the `config.log_level` as is.

This bug was introduced by #11665.

Conflicts:
	railties/CHANGELOG.md
	railties/test/application/configuration_test.rb
Merge pull request #13706 from prathamesh-sonpatki/issue-13125

Fix fields_for documentation with index option [ci skip]
Don't try to get the subclass if the inheritance column doesn't exist

The `subclass_from_attrs` method is called even if the column specified by
the `inheritance_column` setting doesn't exist. This prevents setting associations
via the attributes hash if the association name clashes with the value of the setting,
typically `:type`. This worked previously in Rails 3.2.

(cherry picked from commit e8d1d84837a59ef7d73b29b16ee05cd610d30a90)

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/schema/schema.rb
Merge branch 'ca-touch-commit-callbacks'

Make AR::Base#touch fire the after_commit and after_rollback callbacks.

Closes #12031.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/cases/integration_test.rb
Add back yaml_initialize hook to AR::Core for Syck deserialization support

Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #13723 from BlakeMesdag/add-back-syck-deserialization-hook

Add back yaml_initialize hook to AR::Core for Syck deserialization support

Conflicts:
	activerecord/CHANGELOG.md
Only some dynamic finders are deprecated.

find_by_* and find_by_*! are not deprecated for example, so lets add a
note only where it is needed

[ci skip]
Fix eager load of Serializers on Active Model
Merge pull request #13751 from chancancode/ar_rollback_fix

Restore ActiveRecord states after a rollback for models w/o callbacks
Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #13748 from summerblue/master

Correct the version number to 4 in guides[ci skip]
Merge pull request #9969 from divineforest/fix-find-in-batches

Fail early with "Primary key not included in the custom select clause" i...
Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #13696 from senny/engine_bin_rails_load_bundler

setup Bundler in engines `bin/rails` stub.
`has_one` and `belongs_to` accessors don't add ORDER BY to the queries anymore.

Since Rails 4.0, we add an ORDER BY in the `first` method to ensure consistent
results among different database engines. But for singular associations this
behavior is not needed since we will have one record to return. As this
ORDER BY option can lead some performance issues we are removing it for singular
associations accessors.

Fixes #12623.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/associations/singular_association.rb
Merge pull request #13811 from mdesantis/issue-13810

Fixes #13810 `rake routes` error when mount `Rails::Engine` with empty routes
Conflicts:
	actionpack/CHANGELOG.md
Merge pull request #13829 from qsymmachus/improve_validates_with_example

Reordered classes in AR Validation #validates_with example [ci skip]
Clear filtered request attributes between requests in tests

The request attributes filtered_parameters, filtered_env and filtered_path
are memoized for performance reasons. However this can cause unusual
behavior in tests where there are multiple calls to get, post, etc.

Fixes #13803.

(cherry picked from commit 31616068032beb537768787ff3a206b062eb192e)