This project is archived and is in readonly mode.
Initializer should load files in parent directories before subdirectories to minimize dependency pain
-
Tom Ward
- Tag changed from dependencies, eager_loading to dependencies, eager_loading, patch
I've written a patch (with tests) which sorts the globbed files. Having thought about this in some depth, I'm convinced that eager loading should load parents before children.
In my particular situation (using modules to partition behaviour) I'm aware there are alternative solutions (such as Rick's concerned_with) but I believe using modules is not only simpler but more flexible. In any case, eager loading breaks the concerned_with pattern as it forces all concerns to be loaded, whether declared or not.
-
MatthewRudy
sounds good. +1
-
Repository
- State changed from new to resolved
(from [89d1c77dd012f087c091e0f23874c582ea4e3703]) Initializer to sort files before eager loading. [#859 Initializer should load files in parent directories before subdirectories to ... state:resolved]
Changed Rails::Initializer to sort files before eager loading them. This ensures that any files in a parent directory will be loaded before files in a subdirectory of the 'same' name. i.e. zoo.rb will be loaded before zoo/reptile_house.rb
Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...
