[ci skip]
Closes#40021
I began this commit by adding an additional note about explicitly
requiring initializers. `config/intializers` are loaded with `load`
rather than `require` (and always have been, since they were introduced
way back in c6d6082562). So explicitly requiring them can be problematic
if they are not idempotent.
But @p8 pointed out that it is a bit awkward to have 3 notes and one tip
larger than the actual text in this section.
This commit now also reworks 2 of the notes and the tip into additional
paragraphs in the main text. The benefits of the new version I see:
- We now explicitly say that the initializers are loaded by sort order
- We now start with the ideal way to deal with dependent initializers,
then follow with a couple warnings. We used to lead with what not to
do, which I think was a bit confusing.
- The language around subdirectories is much simpler (mentioning that
subdirectories can be used for organizing seemed unnecessary to me -
that is true of subdirectories in general, and doesn't have any
specific connection to initializers)
This commit does not change the opening paragraph or the note about when
to use `after_initialize` instead, although it does reformat them.
In 7f938ca the test model `Man` was renamed to `Human`. Maybe this is a
good time to also change `horrible_human` and `dirty_human` to
`happy_human` and `confused_human`.
While this change is mostly cosmetic change, the phrase "dirty man" has
a negative meaning.
The adjectives "confused" and "puzzled" were chosen because they are
used for defining associations with errors.
This was added in 6223e2067608aa7fa2ecd2c50e2db74f26ad5914 to allow
`table_name_prefix`, `table_name_suffix`, and `pluralize_table_names` to
be injected instead of always being read from `ActiveRecord::Base`. It
was never documented, and after 336783ad96dbcc3f84a11069e004ea1268b051f4
and 0c843640b49e9ca41232d1402f26780e4f511275 setting it has no effect.
This is an alternative of #29722.
Before Rails 6.1, storing demodulized class name is supported only for
STI type by `store_full_sti_class` class attribute.
Now `store_full_class_name` class attribute can handle both STI and
polymorphic types.
Closes#29722.
See also #29601, #32048, #32148.
The majority of items in this list are clauses that complete the sentence "...you will know...". But the 2nd item was an independent question with its own question mark, and the other changed one had the syntax of a question despite lacking a question mark.