Add :nodoc: to ActiveModel::SecurePassword.min_cost

[ci skip]
Merge pull request #12058 from gaurish/secure-pass-doc

Add nodoc to ActiveModel::SecurePassword.min_cost
Refactoring Generators::Base.

The defaults hash isn't used unless the +class_options+ hash has a
particular key, so we don't need to compute it unless this is true.

Also moving some code for extracting a module into its own method.
Merge pull request #12061 from wangjohn/refactoring_generators_base

Refactoring Generators::Base.
only call to_a when we have to
extract owner id calculation to a method
avoid extra empty array allocation
remove extra flat_map array
no need to to_a the scope
correctly typecast keys, remove conditionals, reduce object allocations
Merge branch 'typecast'

* typecast:
  correctly typecast keys, remove conditionals, reduce object allocations
  no need to to_a the scope
  remove extra flat_map array
  avoid extra empty array allocation
  extract owner id calculation to a method
  only call to_a when we have to
Test that PostgreSQL adapter includes `usec` when quoting `DateTime`
Perf: micro optimised Result column hash_row creation
Merge pull request #12051 from bcherry/preserve_datetime_milliseconds

ActiveRecord: Include usecs when quoting DateTime in PostgreSQL adapter
Small refactoring changes to generators.

Made a method name clearer (added a bang to the end to show that it
mutates arguments) and extracted indentation into its own method.
Port all remaining self.protected_instance_variables to class methods
Merge pull request #12062 from strzalek/default-protected-vars

Port all remaining self.protected_instance_variables to class methods
Note functional equivalence in reset task
Add documentation for rake db:setup task
pk should not be required for hm:t associations