diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-12-22 17:27:37 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-12-22 17:27:37 -0600 |
commit | ace20bd25e3818b7f29c222643dd445c48b36425 (patch) | |
tree | d8bdc5e685f6d4e56e7f6c6e1f0a27fdad8b20ed /activesupport/lib/active_support | |
parent | b1aee9f4eebdae4fad38572359649c097c731b77 (diff) | |
download | rails-ace20bd25e3818b7f29c222643dd445c48b36425.tar.gz rails-ace20bd25e3818b7f29c222643dd445c48b36425.tar.bz2 rails-ace20bd25e3818b7f29c222643dd445c48b36425.zip |
Flip deferrable autoload convention
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/dependencies/autoload.rb | 10 |
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! |