Permalink
Browse files

load_application_classes requires files relative to the load path and…

… without .rb extension, including .rb files in subdirectories
  • Loading branch information...
1 parent 2617d0d commit a540725f0d3439ea3b0f938d04ceed87d3690d9d @jeremy jeremy committed Jul 31, 2008
Showing with 3 additions and 2 deletions.
  1. +3 −2 railties/lib/initializer.rb
@@ -349,8 +349,9 @@ def load_view_paths
def load_application_classes
if configuration.cache_classes
configuration.eager_load_paths.each do |load_path|
- Dir.glob("#{load_path}/*.rb").each do |file|
- require_dependency file
+ matcher = /\A#{Regexp.escape(load_path)}(.*)\.rb\Z/
+ Dir.glob("#{load_path}/**/*.rb").each do |file|
+ require_dependency file.sub(matcher, '\1')
end
end
end

1 comment on commit a540725

Contributor

dissolved commented on a540725 May 30, 2009

Any thoughts on adding a preference to NOT eager load .rb files in subdirectories?

Please sign in to comment.