Build fix for scaffold generator 

3-2 behaves different when scaffolding.
Merge pull request #10496 from arunagw/build-fix-scaffold-generator

Build fix for scaffold generator
Revert "Remove unicode character encoding from ActiveSupport::JSON.encode"

This reverts commit 815a9431ab61376a7e8e1bdff21f87bc557992f8.

Conflicts:
	activesupport/test/json/encoding_test.rb

Reason: This was causing a regression where the resulting string is always
returning UTF-8. Also it changes the behavior of this method on a stable release.

Fixes #9498.
Revert "Merge pull request #8209 from senny/backport_8176"

This reverts commit 724020278480855bddfe749c91f1074d4f50f3c6, reversing
changes made to e4e2bcce75b85fb8c1c49509a17bd5dfe6034c32.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation/calculations.rb
	activerecord/test/cases/calculations_test.rb

Reason: This caused a regression since it changed the behavior in a
stable release.

Fixes #9777