Use latest 2.1 version of sprockets-rails
Merge pull request #16649 from Agis-/pg-columns-for-distinct

Fix postgresql adapter #columns_for_distinct trimming whitespace it shouldn't
CHANGELOG & improvements to #16649

* Require either FIRST or LAST qualifier for "NULLS ..."
* Require whitespace before "NULLS ..."
Merge pull request #16664 from rubys/4-1-stable

Use latest 2.1 version of sprockets-rails
Clarify that unknown keys will become HTML attrs

Docs for all the other form tag helpers in this
file already clarify this.

[ci skip]
Remove erroneous form_tag option docs

This is true of the first param (url_for_options),
not of the second options param which is being
documented here.

[ci skip]
Merge pull request #16693 from tjschuck/form_for_doc_options_4-1

Backport: documentation update for form_for options
Fixed automatic maintaining test schema to properly handle sql structure schema format.

Additionally:
* It changes `purge` task on `sqlite3` adapter to recreate database file, to
be consistent with other adapters.
* Adds `purge` step when loading from `schema.rb`

Conflicts:
	activerecord/CHANGELOG.md
	railties/test/application/test_test.rb
Merge pull request #16316 from rails/senny/purge_schema_maintenance

purge database before loading schema, take 2
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/tasks/database_tasks.rb
remove deprecation warning which is not yet issued.

This will be deprecated with `4.2`. [ci skip]
fix, mysql `db:purge` respects `Rails.env`.

Previously this method always established a connection to the test database.
This resulted in buggy behavior when combined with other tasks like
`bin/rake db:schema:load`.

This was one of the reasons why #15394 (22e9a91189af2c4e6217a888e77f22a23d3247d1)
was reverted:

> I’ve replicated it on a new app by the following commands: 1) rails
  generate model post:title, 2) rake db:migrate, 3) rake
  db:schema:load, 4) rails runner ‘puts Post.first’. The last command
  goes boom. Problem is that rake db:schema:load wipes the database,
  and then doesn’t actually restore it. This is all on MySQL. There’s
  no problem with SQLite.

  -- DHH

https://github.com/rails/rails/commit/22e9a91189af2c4e6217a888e77f22a23d3247d1#commitcomment-6834245

Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #16739 from y-yagi/patch-6

[ci skip] Fix example code of ActiveRecord::FixtureSet.context_class
Merge pull request #16756 from huoxito/dont-mess-railties-default-order

Dont mess with default order engines load (4.1.6.rc1 regression)
Merge pull request #16795 from Peeja/methods-are-not-duplicable

Methods are not duplicable.
Conflicts:
	activesupport/CHANGELOG.md
	activesupport/test/core_ext/duplicable_test.rb
schema loading rake tasks maintain database connection for current env.

[Joshua Cody & Yves Senn]

Closes #16757.

Prior to this patch schema loading rake tasks had the potential to leak a
connection to a different database. This had side-effects when rake tasks
operating on the current connection (like `db:seed`) were chained.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/tasks/database_tasks.rb
	activerecord/test/cases/tasks/database_tasks_test.rb
Enums shouldn't ruin people's anniversaries

Added a few more methods on Module/Class to the dangerous class methods
blacklist. (Technically, allocate and new are already protected currently because
we happen to redefine them in the current implantation.)

Closes #16792
Merge pull request #14911 from estsauver/14908

Propagate test messages through assert_routing helper, Fixes #14908
Do not mark object as persisted after an association is saved

Callback order in Active Record objects are important. Users should not
define callbacks before the association definition or surprising
behaviours like the described at #3798 will happen. This callback order
dependency is documented at https://github.com/rails/rails/blob/31bfcdc77ca0d8cec9b5fe513bdc6f05814dd4f1/activerecord/lib/active_record/associations.rb#L1222-1227.

This reverts #15728.

Fixes #16620.

Conflicts:
	activerecord/test/cases/associations/has_many_associations_test.rb