Fix the release task
Preparing for 4.0.6.rc1 release
Revert "Merge pull request #12778 from etehtsea/rake-default-fix"

This reverts commit a263d0b368fbd074bff3ee9058d13b457eaa3116.

Conflicts:
	railties/CHANGELOG.md
Upgrading Ruby on Rails guide is no longer WIP [ci skip]
Merge pull request #11896 from nkondratyev/fix_pg_columns_for_distinct

Fixed #columns_for_distinct of postgresql adapter

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
Change the version schema to reflect how deprecations are handled

[ci skip]

We only introduce new deprecations at Minor releases.
Merge pull request #15493 from bf4/relax_mail_dep

Relax mail gem constraint from ~> 2.5.4 to ~> 2.5
For our build, stick with mail 2.5.x for now

2.6 currently has many warnings, which are failing the Travis build.

Conflicts:
	Gemfile
`bin/rake db:migrate:status` works with legacy migration numbers.

The migration numbers were normalized different ways. This left
the task output in an inconsistent state.

Closes #15538.

Conflicts:
	activerecord/CHANGELOG.md
Skip individual tests upon Dalli::RingError

Unlike the outer `rescue`, this one is much more precise about what we
want to handle: a connection failure (`Dalli::RingError`) is not
relevant to what we're testing here. But other Dalli errors may well be
indicating an actual problem.
`ActiveRecord::SchemaMigration` has no primary key.

Before this patch, using `ActiveRecord::Base.primary_key_prefix_type`
with `:table_name_with_underscore` would change the `SchemaMigration` model
to have a primary key. This resulted in broken queries for PG because it tried
to return the inserted PK (which does not exist).

Closes #15051.
Closes #15419.

Conflicts:
	activerecord/lib/active_record/schema_migration.rb
 Mail 2.6.1 silences excessive warnings; remove Gemfile hack

Completes https://github.com/rails/rails/pull/15493

Revert "For our build, stick with mail 2.5.x for now"

This reverts commit bea0d10222567d2c930f2a5005d32354b70ac415.
Merge pull request #15575 from bf4/4-0-stable

Mail 2.6.1 silences excessive warnings; remove Gemfile hack
Do not try to set the foreign_key again on has_many through

Integration tests are inside protected_attributes test suite.

Fixes #15496
Fixes rails/protected_attributes#35
Do not try to set the foreign_key again on has_many through

Integration tests are inside protected_attributes test suite.

Fixes #15496
Fixes rails/protected_attributes#35
Timestamp values should be present on callbacks

This reverts commit dd3ea17191e316aeebddaa7b176f6cfeee7a6365 and add a
regression test.

Fixes #15418

Conflicts:
	activerecord/CHANGELOG.md
Timestamp values should be present on callbacks

This reverts commit dd3ea17191e316aeebddaa7b176f6cfeee7a6365 and add a
regression test.

Fixes #15418

Conflicts:
	activerecord/CHANGELOG.md
Add test to make sure HashWithIndifferentAccess works like Hash
Merge pull request #15584 from jamesyang124/issue_15382

ActiveRecord::FinderMethods.find doesn't pass proc parameter to array

Manual merge of #15584.

Closes #15584.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/cases/finder_test.rb
Set the status before of setting the response body

The 401 status should be set first because setting the response body in
a live controller also closes the response to further changes.

Fixes #14229.