diff options
author | José Valim <jose.valim@gmail.com> | 2010-07-17 09:54:34 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-07-17 09:55:11 +0200 |
commit | c6e20586372743ce200449bf0ac21aed04c6b81e (patch) | |
tree | 8615ad840ac5f02a9e4be4b82df074934d28342a /railties/lib | |
parent | 38f1ea8fe267947f4baf832d3b15ee5b83f18f71 (diff) | |
download | rails-c6e20586372743ce200449bf0ac21aed04c6b81e.tar.gz rails-c6e20586372743ce200449bf0ac21aed04c6b81e.tar.bz2 rails-c6e20586372743ce200449bf0ac21aed04c6b81e.zip |
Add skip_eager_load!, skip_autoload! and friends to path objects.
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/paths.rb | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index 7a65188a9a..d303212f52 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -116,36 +116,20 @@ module Rails @paths.concat paths end - def autoload_once! - @autoload_once = true - end - - def autoload_once? - @autoload_once - end - - def eager_load! - @eager_load = true - end - - def eager_load? - @eager_load - end - - def autoload! - @autoload = true - end - - def autoload? - @autoload - end + %w(autoload_once eager_load autoload load_path).each do |m| + class_eval <<-RUBY, __FILE__, __LINE__ + 1 + def #{m}! + @#{m} = true + end - def load_path! - @load_path = true - end + def skip_#{m}! + @#{m} = false + end - def load_path? - @load_path + def #{m}? + @#{m} + end + RUBY end def paths |