1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Update configuring.md

It was brought to my attention that the Rails guide suggests using filenames to ensure code load order, so I thought I would suggest a better alternative.
This commit is contained in:
Kelly Stannard 2017-11-14 19:26:03 -05:00 committed by GitHub
parent 570ae8f873
commit 9d87a172ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1057,7 +1057,7 @@ After loading the framework and any gems in your application, Rails turns to loa
NOTE: You can use subfolders to organize your initializers if you like, because Rails will look into the whole file hierarchy from the initializers folder on down.
TIP: If you have any ordering dependency in your initializers, you can control the load order through naming. Initializer files are loaded in alphabetical order by their path. For example, `01_critical.rb` will be loaded before `02_normal.rb`.
TIP: While Rails supports numbering of initializer file names for load ordering purposes, a better technique is to place any code that need to load in a specific order within the same file. This reduces file name churn, makes dependencies more explicit, and can help surface new concepts within your application.
Initialization events
---------------------