One not technical reason for putting them in the initializers is the purpose of the file.
Because overwriting ActiveRecord is a one time task, it make sense to put it there, I think.
But, for the technical reason, you could put the file not in the initializers itself, but you could locate a folder inside
app and put it there, but you have to follow the rules of autoloading, in particular the rule of the naming of the files.
That rule was the main one that was forbidding me to put code in the
app/whatever folders: you have to match the name of the class with the name of the file and the name of a module with the name of a folder (now that I think about it, you are forced to write classes, like if Ruby was not already forcing you to write them anyways).
e.g: the following example would be autoloaded correctly:
Files in the
config/initializers folder are not tied to this rule but tied to the rules of initializers. That don’t know them 100%, except you have to stop
spring stop) to reload the file if changed.