These things are usually in the RAILS_ROOT/lib directory. Everything in this directory is automatically loaded when Rails is loaded, although NB, unlike the files in the app directory, these libraries are not re-evaluated for each request, even in development mode, so if you are going to test the changes on the fly, you It's best to test your libraries yourself and wait for them to be polished before putting the final version into your lib .
The Rails Guides describe the actual file upload order, although you are completely free to ignore the order and “jump” gun, require with the file earlier.
source share