提交 0533ee45 编写于 作者: J José Valim

Merge pull request #5387 from panthomakos/autoload

Improved ActiveSupport::Autoload Performance
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册