Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #5387 from panthomakos/autoload

Improved ActiveSupport::Autoload Performance
  • Loading branch information...
commit 0533ee45a7a03145d4a37a2b6e3275c6f625a295 2 parents 6c0d5a1 + 6b480d2
José Valim josevalim authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 activesupport/lib/active_support/dependencies/autoload.rb
11 activesupport/lib/active_support/dependencies/autoload.rb
View
@@ -9,13 +9,16 @@ module Autoload
@@eager_autoload = false
def autoload(const_name, path = @@at_path)
- full = [self.name, @@under_path, const_name.to_s, path].compact.join("::")
- location = path || Inflector.underscore(full)
+ unless path
+ full = [name, @@under_path, const_name.to_s, path].compact.join("::")
+ path = Inflector.underscore(full)
+ end
if @@eager_autoload
- @@autoloads[const_name] = location
+ @@autoloads[const_name] = path
end
- super const_name, location
+
+ super const_name, path
end
def autoload_under(path)
Please sign in to comment.
Something went wrong with that request. Please try again.