Merge pull request #14518 from Peeja/hash-wia-update-respects-to-hash-4-1-stable

HashWithIndifferentAccess better respects #to_hash (4-1-stable backport)
Conflicts:
	activesupport/CHANGELOG.md
Fix build with bundler 1.6
Merge pull request #14509 from lukesteensen/pg-array-defaults

remove calls to sql_type on pg columns
Conflicts:
	activerecord/lib/active_record/connection_adapters/abstract/schema_creation.rb
	activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
	activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
	activerecord/test/cases/adapters/postgresql/array_test.rb
Tiny doc fix for Strong Parameters

- accepts_nested_attribute_for -> accepts_nested_attributes_for
Merge pull request #14539 from lparedes/master

Do not overwrite selected and disabled attributes
Conflicts:
	actionpack/lib/action_view/helpers/form_options_helper.rb
Fix polymorphic preloads on NOT NULL _type columns.

Defer to Association#klass instead of having a custom/duplicate code.
Simplify Preloader#grouped_records code.

The new method relies on AR::Associations::Association knowing about both reflection and a model class.

AR::Base#association now raises a descriptive error when trying to access non-existent associations. Previously it would blow up with a confusing NoMethodError: undefined method `association_class' for nil:NilClass.
Merge pull request #14572 from laurocaetano/with_options_and_scope

Fix error when using `with_options` with lambda.

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/cases/associations/has_many_associations_test.rb
Merge pull request #14562 from jefflai2/collection_proxy

CollectionProxy uses the arel of its association's scope.

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/cases/relations_test.rb
Stray nodoc causes rest of file not parsed [ci skip]
Merge pull request #11650 from prathamesh-sonpatki/rename

Renamed private methods _create_record and _update_record

Conflicts:
	activerecord/lib/active_record/persistence.rb
	activerecord/lib/active_record/relation.rb
	activerecord/test/cases/associations/belongs_to_associations_test.rb
Fix the test defining the models in the right place

Conflicts:
	activerecord/test/cases/associations/belongs_to_associations_test.rb
	activerecord/test/schema/schema.rb
Merge pull request #14631 from laurocaetano/fix_count_with_order

Ignore order when doing count.
Allow to use sprockets-rails 2.1
Define the required asset
Merge pull request #12829 from iantropov/issue_insert_via_hmt_scope_3548

Fix insertion of records for hmt association with scope

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation.rb
Merge pull request #14684 from Futurelearn/jc-deep-nested-shallow-url-helper-bug

Add a failing test for a URL helper that was broken by a6b9ea2.

(cherry picked from commit 142448259d7f450df49fdac06bf912edfecaa633)

Conflicts:
	actionpack/CHANGELOG.md
Changed change_column in PG schema_statements.rb to make sure that the uuid_generate function was not being quoted