aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/dependencies/autoload.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-12-25 12:09:13 +0100
committerJosé Valim <jose.valim@gmail.com>2009-12-25 12:09:13 +0100
commiteb8e627c6918dae53c7ab8b9208e72ff64d20348 (patch)
tree4f153960d158c119ebdcef7a3a02c407e4b82dd0 /activesupport/lib/active_support/dependencies/autoload.rb
parent4b8330d2d50ae4de14dd43ffbea4d91804553140 (diff)
parent1c66f85eb6cd80053cf60889634a8c39c21b11a1 (diff)
downloadrails-eb8e627c6918dae53c7ab8b9208e72ff64d20348.tar.gz
rails-eb8e627c6918dae53c7ab8b9208e72ff64d20348.tar.bz2
rails-eb8e627c6918dae53c7ab8b9208e72ff64d20348.zip
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'activesupport/lib/active_support/dependencies/autoload.rb')
-rw-r--r--activesupport/lib/active_support/dependencies/autoload.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/dependencies/autoload.rb b/activesupport/lib/active_support/dependencies/autoload.rb
index 96ab04c61a..44edb89ad5 100644
--- a/activesupport/lib/active_support/dependencies/autoload.rb
+++ b/activesupport/lib/active_support/dependencies/autoload.rb
@@ -5,13 +5,13 @@ module ActiveSupport
@@autoloads = {}
@@under_path = nil
@@at_path = nil
- @@autoload_defer = false
+ @@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 @@autoload_defer
+ if @@eager_autoload
@@autoloads[const_name] = location
end
super const_name, location
@@ -31,11 +31,11 @@ module ActiveSupport
@@at_path = old_path
end
- def deferrable
- old_defer, @@autoload_defer = @@autoload_defer, true
+ def eager_autoload
+ old_eager, @@eager_autoload = @@eager_autoload, true
yield
ensure
- @@autoload_defer = old_defer
+ @@eager_autoload = old_eager
end
def self.eager_autoload!