Merge pull request #15012 from schneems/schneems/headers-key

HTTP::Headers#key? correctly converts
Merge branch 'rm-trasaction-fix-13166'

Conflicts:
	activerecord/CHANGELOG.md

Backport of #13166
Merge pull request #12746 from coreyward/master

Fix Hash#deep_merge bug and improve documentation — resolves #12738
Merge pull request #15015 from pothibo/database-configuration

Use Rails::Paths::Path#existent in database_configuration
Conflicts:
	railties/CHANGELOG.md
Dup the changed_attributes otherwise we could lose them
Merge pull request #14992 from fredwu/habtm_relation_size_calculation_fix

Habtm relation size calculation fix. Fixes #14913, Fixes #14914.

Conflicts:
	activerecord/CHANGELOG.md
set a constant for the "anonymous" habtm model fixes #15022

I wanted the middle model to be anonymous, but we have to give it a name
for marshal support. :'(
Merge pull request #15042 from arthurnn/revert_dirty_transactions

Reverts dirty track restore on transactions rollback
Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #15044 from zzak/travis_ruby_too_won

Only need MINOR version level to test Ruby 2.1.x on Travis
Conflicts:
	.travis.yml
use fnmatch to test for case insensitive file systems

this is due to:

  https://bugs.ruby-lang.org/issues/5994
feature detect for FNM_EXTGLOB for older Ruby. Fixes #15053
ActionDispatch::Http::URL.normalize_port should not strip port for protocol relative URL.

(cherry picked from commit be93d94ef28421a2dbcd6ed870b454433a5a0a72)
Always use the provided port for protocol relative urls

There may be situations where you need to tunnel SSL connections over
port 80 so we shouldn't remove it if it has been explicitly provided.

(cherry picked from commit 2378f69e69f98460f426d2c4e0fbb967b4fa5ddf)

Conflicts:
	actionpack/CHANGELOG.md
Merge pull request #10505 from patricksrobertson/bigserial_id_not_identifying_pk

Handle other pk types in PostgreSQL gracefully.

Closes #10505.

- rebased
- test slightly modified

Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #13334 from gregolsen/postgresql_infinity

pg, fix Infinity and NaN values conversion.

Closes #13334.

* rebased
* removed guard
* inlined guard into case statement
pg, `change_column_default` accepts `[]`. Closes #11586.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/connection_adapters/postgresql/quoting.rb
Merge pull request #14999 from yahonda/modify_bind_variable_name

Modify assert conditions not to be affected
by each database bind variable naming conventions

Closes #14999.

Conflicts:
	activerecord/test/cases/relation/merging_test.rb
docs, explain usage of `count` + `select`. Closes #15065. [ci skip]
Fix regression on `assert_redirected_to`.

`assert_redirected_to` would fail if there is no controller set on
a `ActionDispatch::IntegrationTest`, as _compute_redirect_to_location
would be called on the controller to build the url.

This regression was introduced after 1dacfbabf3bb1e0a9057dd2a016b1804e7fa38c0.

[fixes #14691]
Merge pull request #15090 from arthurnn/fix_assert_redirected_to_41

Fix regression on `assert_redirected_to`, 4-1-stable