add include_hidden option to collection_check_boxes helper
Save has_one associations only if record has changes

Prevents save related callbacks such as `after_commit` being
triggered when `has_one` objects are already persisted and have no
changes.
Don't load test env by default
Only use BINARY for mysql case sensitive uniqueness check when column has a case insensitive collation.
Prevent foreign_key_for? from type casting all attributes
Revert "Only lookup `config.log_level` for stdlib `::Logger`. Closes #11665."

This reverts commit e0a521cfcd13e4d1f0ae8ab96004289e1c020f71.

Conflicts:
	railties/CHANGELOG.md

We expect loggers to quack like stdlib logger. If log4r needs different
level= assignment, using a Logger-quacking wrapper is the way to do it.

Fixes #14114.
Merge pull request #14140 from WojtekKruszewski/optimize_foreign_key_for

Prevent foreign_key_for? from evaluating all attributes
Handle missing environment from non empty config

If using a `DATABASE_URL` and a `database.yml`. The connection information in `DATABASE_URL` should be merged into whatever environment we are in. As released in 4.1.0rc1 if someone has a database.yml but is missing a key like production:

```yml
development:
  host: localhost

```

Then the check for blank config will return false so the information from the `DATABASE_URL` will not be used when attempting to connect to the `production` database and the connection will incorrectly fail.

This commit fixes this problem and adds a test for the behavior.

In addition the ability to specify a connection url in a `database.yml` like this:

```
production: postgres://localhost/foo
```

Was introduced in 4.1.0rc1 though should not be used, instead using a url sub key

```
production:
  url: postgres://localhost/foo
```

This url sub key was also introduced in 4.1.0rc1 though the `production: postgres://localhost/foo` was not removed. As a result we should not test this behavior.
Pass a base relation to build_default_scope when joining

This allows the default scope to be built using the current table alias.
Resolves #12770
Distinguish ConnectionNotEstablished messages: no conn pool for the class, or no conn available from the pool
typos fixes
Fixed typo in comment about MAX_ID.
Merge pull request #14164 from vajrasky/fix_typo_max_id

Fixed typo in comment about MAX_ID.
Tweak Configuring Guide language

the fact that Rails is multi-thread by default is not very relevant. see https://github.com/rails/rails/pull/13998 [ci skip]
Add warning when user tried to create model with pluralize name.
  1. Generate model with correct_name.
  2. It will help new users to avoid mistakes when tried to create model with wrong name.
Merge pull request #13515 from kuldeepaggarwal/f-model-generation

Added warning when user tried to create model with pluralize name.
:scissors:

This commit also addresses rails/docrails#169 and rails/rails#14159
Add tests for default scope behaviour change

See #13875
dynamically define PostgreSQL OID range types.

This gets AR working with custom defined range types. It also
removes the need for subtype specific branches in `OID::Range`.

This expands the interface of all `OID` types with the `infinity` method.
It's responsible to provide a value for positive and negative infinity.
deprecate support for pg ranges with excluding beginnings.

The Ruby Range object does not support excluding beginnings.
We currently support excluding beginnings for some subtypes using
manually by incrementing them (now using the `#succ` method).
This is approach is flawed as it's not equal to an excluding beginning.

This commit deprecates the current support for excluding beginnings.
It also raises an `ArgumentError` for subtypes that do not implement the `succ`
method.

This is a temporary solution to get rid of the broken state. We might still
add complete support for excluding beginnings afterwards. (Probably with a
new `PGRange` object, which acts like a `Range` but has excluding beginnings.