Use a type object for type casting behavior on SQLite3

Note: I'm not sure we actually need to be logging when this happens.
This code would be a fair bit cleaner if we didn't need to log it.
Improve token_and_options regex and test

add a test case to test the regex for the helper method raw_params
Move pk initialization logic onto `AttributeSet`

Better encapsulates its internals from `ActiveRecord::Base`.
[ci skip] Changes some wording to better foreshadow what is coming up later.
This should prevent some anxiety readers may experience when the doc goes into something different than what it just explained. Also clarifies a statement about priority in engines and application environments

[ci skip] fixes double `the`

[ci skip] more clarifications

[ci skip] changes from tics to quotes
Merge pull request #16015 from sgrif/sg-ensure-initialized

Move pk initialization logic onto `AttributeSet`

Conflicts:
	activerecord/lib/active_record/attribute_set.rb
automatically include ActiveModel::Validations when include ActiveModel::SecurePassword
Merge pull request #16024 from aditya-kapoor/include-validations

automatically include ActiveModel::Validations when include ActiveModel::SecurePassword
`DateTime#to_f` now preserves fractional seconds.

Previously this method always returns `.0` in the fractional part. This commit
changes it to preserve the fractional seconds instead.

Fixes #15994.
Merge pull request #16001 from johnpaulashenfelter/jp_fix_datetime_to_f

`DateTime#to_f` now preserves fractional seconds.
Only automatically include validations when enabled

This is a follow up to #16024.
Fix escape_once double-escaping hex-encoded entities

(This is a manual merge of #9102)
The hex escape sequence can be of any length
Add CHANGELOG for c803b90
Change the JSON renderer to enforce the 'JS' Content Type

The controller can set the response format as 'JSON' before the renderer code be
evaluated, so we must replace it when necessary.

Fixes #15081
Remove symbolized_path_parameters.

This pull request is a continuation of https://github.com/rails/rails/commit/925bd975 and https://github.com/rails/rails/commit/8d8ebe3d.
Merge pull request #16026 from lucasmazza/lm-respond-to-jsonp-fix

Change the JSON renderer to enforce the 'JS' Content Type
Add `:all` argument to `count` in `reset_counters`

Prior to this fix, if an association had a scope with a `select`,
calls to `reset_counters` would generate invalid SQL and throw:

ActiveRecord::StatementInvalid: [$DB_ADAPTER]: wrong number of
arguments to function COUNT()

References #10710, #13648
Fix typo in comment
Merge pull request #16029 from cade/fix_typo_in_comment

Fix typo in comment
Merge pull request #15941 from variousred/docrails-changes

[ci skip] Changes some wording to better foreshadow what is coming up later