Merge pull request #13236 from jetthoughts/13230_type_cast_bug_in_agr_functions

Fix type cast on group sum with custom expression
Conflicts:
	activerecord/CHANGELOG.md