Make remote_ip detection properly handle private IPv6 addresses

Fixes #12638.
SQLite3: Always close statements.

SQLite3 adapter must make sure to close statements after queries.

Fixes: #13631
rewrites the API docs of favicon_link_tag [ci skip]

Motivated by #14907.
the use of ... in place >> using ... instead

[ci skip]
Merge pull request #14909 from jonatack/patch-7

the use of ... in place >> using ... instead
split nil / Hash cases in url_for

this reduces the number of comparisons and method calls `url_for`
requires.  The nil case no longer calls `symbolize_keys`, we already
know options is nil, so no more ||=, and since it is nil we already know
that options[:host] will be nil too.
Stringify variables names for mysql connections

For mysql2/mysql adapters, `sql_mode` variable name set in `database.yml`
as string, was ignored and `sql_mode` was set to use strict mode.

Fixes #14895
don't allocate string on hash access
do not allocate strings while creating urls
eliminate conditional when sending the named route method
avoid calling extract_record multiple times
[skip ci] Document: required `via` option in `match` routing method.
Add documentation to select_tag for :selected option
Give real privacy to class methods in AR::PredicateBuilder
Merge pull request #14916 from moktin/real_privacy_for_functions_in_predicate_builder

Give real privacy to class methods in AR::PredicateBuilder
Merge pull request #14922 from rizwanreza/add-selected-documentation-to-select-tag

Add documentation to select_tag for :selected option
Avoid unnecessary conditional block

GeneratedAttribute#column_name checks already for reference? on the
attribute returning the right name to use as symbol for label and field.
Merge pull request #14928 from potomak/update-scaffold-form-template

Avoid unnecessary conditional block
Merge pull request #13640 from maginatics/fix_sqlite3_ensure_master

SQLite3: Always close statements.

Conflicts:
	activerecord/CHANGELOG.md
Remove unused variable