Skip to content
Browse files

fixes a bug in dependencies.rb

loaded stores file names without the .rb extension, but search_for_file
returns file names with the extension.

The solution is hackish, but this file needs a revamp.
  • Loading branch information...
1 parent 265c8b7 commit db8ff15a497191a952e47ed8ba761f6c2cf4a1f3 @fxn fxn committed Aug 28, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activesupport/lib/active_support/dependencies.rb
2 activesupport/lib/active_support/dependencies.rb
@@ -479,7 +479,7 @@ def load_missing_constant(from_mod, const_name)
file_path = search_for_file(path_suffix)
- if file_path && ! loaded.include?(File.expand_path(file_path)) # We found a matching file to load
+ if file_path && ! loaded.include?(File.expand_path(file_path).sub(/\.rb\z/, '')) # We found a matching file to load
require_or_load file_path
raise LoadError, "Expected #{file_path} to define #{qualified_name}" unless from_mod.const_defined?(const_name, false)
return from_mod.const_get(const_name)

0 comments on commit db8ff15

Please sign in to comment.
Something went wrong with that request. Please try again.