Merge pull request #14803 from kuldeepaggarwal/null_relation_sum_fix

Fixed a problem where `sum` used with a `group` was not returning a Hash.

Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #14613 from Sirupsen/fix-serialize-update-column

Fix serialized field returning serialized data after update_column

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #15251 from peeyushsingla/master

Reorder query in active record query of rails guide [ci skip]
Conflicts:
	guides/source/active_record_querying.md
Remove warning removing the method before redefining

We need to test if the same method defined more than once only register
one subscriber for it. We can safelly remove because the method body is
the same and Subscriber use method_added hook for register the
subscriber.
Merge pull request #14850 from chancancode/fix_json_cookie_jar

Fixed an issue with migrating legacy json cookies.
Conflicts:
	actionpack/CHANGELOG.md
Merge pull request #15240 from chancancode/fix_attribute_methods

Fixed serialization for records with an attribute named `format`.
Conflicts:
	activerecord/CHANGELOG.md
doc, pg `hstore` and `json` columns are mapped as `Hash`. [ci skip]

Closes #15141.
Remove the assignment for real this time.

cc:
https://github.com/rails/rails/commit/a11e2fcff8cdc9691b977d8330abe63024f8c732#commitcomment-6353614
and 0369dbf

Conflicts:
	activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb
Merge pull request #15287 from zzak/backport_14871

Backport 14871
Add has_and_belongs_to_many back to reflections hash.

This adds back `has_and_belongs_to_many` reflection to the reflections
hash. Even thought we are not using that internally, as
`Model.reflections` is a public method we need to keep the hash of
reflections coherent.

ad7b5efb55bcc2e0ccd3e7f22a81e984df8676d1 is the commit that made
has_and_belongs_to_many became a has_many :through and a has_many.

[fixes #14682]
Small test syntax change
Replace reflect_on_all_associations internally
Add _reflect_on_association method for internal use

Internally we wanna look-up the reflection by the association name in
the private list of reflections, so I am adding a
_reflect_on_association method that does that.
Make HasManyThroughSourceAssociationNotFoundError use _reflections

- No need to use .map(:to_s)
- Add @api public to reflections
Add changelog for #15210