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`
Merge pull request #12051 from bcherry/preserve_datetime_milliseconds

ActiveRecord: Include usecs when quoting DateTime in PostgreSQL adapter
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
pk should not be required for hm:t associations
make sure there are actually some categories when running the test
Fix broken link to Fixtures documentation on guides
and activerecord tests

[ci skip]
Remove not necessary AR changelog entry, fix markup [ci skip]
Stop messing up with instance variables, use protected as it was meant for