avoid using alias in generators

Ruby's alias produces public methods, causing a spurious Thor task
to be created.  For example, this is the reason MigrationGenerator
currently has two tasks:

    > ActiveRecord::Generators::MigrationGenerator.all_tasks.keys
    => ["singular_name", "create_migration_file"]

singular_name was meant to be an attribute, not a task.  Because it's
public, it gets called as a task every time the generator is invoked.

The fix is to ensure all generator methods have the correct
visibility.
Hash#deep_*_keys(!) recurse into nested arrays.

Following methods now recursively transform nested arrays, too.

* Hash#deep_transform_keys
* Hash#deep_transform_keys!
* Hash#deep_stringify_keys
* Hash#deep_stringify_keys!
* Hash#deep_symbolize_keys
* Hash#deep_symbolize_keys!
Fix serialized field returning serialized data after update_column
Fixes Issue #13466.

Changed the call to a scope block to be evaluated with instance_eval.
The result is that ScopeRegistry can use the actual class instead of base_class when
caching scopes so queries made by classes with a common ancestor won't leak scopes.
Fixed a problem where `sum`, `size`, `average`, `minimum` and `maximum` used
with a grouping was not returning a Hash.
Delegate `klass` to the injected type object
Revert "Revert "Merge pull request #8313 from alan/only_save_changed_has_one_objects""

This reverts commit e94e6c27af495a2460c811bb506459f1428dec6b.

Conflicts:
	activerecord/CHANGELOG.md

The original commit was reverted only to be safe since #14407 were reported.
We don't have any proof we added a regression with the original commit
so reverting it now will give us more problem.

Closes #14407
Merge pull request #14979 from brocktimus/master

Making belongs_to: touch behaviour be consistent with save updating updated_at
Merge pull request #15205 from sgrif/sg-delegate-klass

Delegate `klass` to the injected type object
Merge pull request #14544 from jefflai2/named_scope_sti

Fixes Issue #13466.

Conflicts:
	activerecord/CHANGELOG.md
Merge pull request #10887 from sakuro/deep_transform_keys_in_nested_arrays

Hash#deep_*_keys(!) recurse into nested arrays.

Conflicts:
	activesupport/CHANGELOG.md
Remove redundant code.
Merge pull request #15213 from tgxworld/remove_redundant_code

Remove redundant code.
Fix polymorphic eager load with foreign_key as String.

The foreign_key could be `String` and just doing `owners_map[owner_key]`
could return `nil`.
To prevent this bug, we should `to_s` both keys if their types are
different.

Fixes #14734.
Merge pull request #14855 from laurocaetano/fix_polymorphic_with_string_key

Fix polymorphic eager load with foreign_key as String.
pg, extract money tests into separate file.

- Added assertions about the column. Specifically scale.
- Move record insertion from setup into test method.
push `extract_scale` to the `Type`.

  - `extract_precision`, `extract_limit`, and `extract_default` probably need to follow.
  - would be good to remove the delegation `Column#extract_scale`.

/cc @sgrif
build fix, use lambda syntax that ruby 1.9.3 understands.
Move PG OID types to their own files

As we promote these classes to first class concepts, these classes are
starting to gain enough behavior to warrant being moved into their own
files. Many of them will become quite large as we move additional
behavior to the type objects.
fix formatting and text for ActionController::Redirecting doc