From 9d87a172ca32d60526f2b4c4ace0c5dc333f8489 Mon Sep 17 00:00:00 2001 From: Kelly Stannard Date: Tue, 14 Nov 2017 19:26:03 -0500 Subject: 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. --- guides/source/configuring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/configuring.md b/guides/source/configuring.md index 2d03f0a61e..6e129a5680 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -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 --------------------- -- cgit v1.2.3