diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-11-23 16:35:13 -0600 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-11-23 16:35:47 -0600 |
commit | 31ce92f7b5784bc5b6a441e88cd734c7b8b1c58f (patch) | |
tree | ec452cb5dd933f0fc89f9b230a35f70528145950 /actionpack/lib/action_controller/caching.rb | |
parent | 6de1060eb555b5053f7d95269ceb23fce04e0523 (diff) | |
download | rails-31ce92f7b5784bc5b6a441e88cd734c7b8b1c58f.tar.gz rails-31ce92f7b5784bc5b6a441e88cd734c7b8b1c58f.tar.bz2 rails-31ce92f7b5784bc5b6a441e88cd734c7b8b1c58f.zip |
Use autoload instead of explicit requires for ActionController
Diffstat (limited to 'actionpack/lib/action_controller/caching.rb')
-rw-r--r-- | actionpack/lib/action_controller/caching.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb index c4063dfb4b..b4d251eb3c 100644 --- a/actionpack/lib/action_controller/caching.rb +++ b/actionpack/lib/action_controller/caching.rb @@ -2,13 +2,6 @@ require 'fileutils' require 'uri' require 'set' -require 'action_controller/caching/pages' -require 'action_controller/caching/actions' -require 'action_controller/caching/sql_cache' -require 'action_controller/caching/sweeping' -require 'action_controller/caching/fragments' - - module ActionController #:nodoc: # Caching is a cheap way of speeding up slow applications by keeping the result of calculations, renderings, and database calls # around for subsequent requests. Action Controller affords you three approaches in varying levels of granularity: Page, Action, Fragment. @@ -31,6 +24,12 @@ module ActionController #:nodoc: # ActionController::Base.cache_store = :mem_cache_store, "localhost" # ActionController::Base.cache_store = MyOwnStore.new("parameter") module Caching + autoload :Actions, 'action_controller/caching/actions' + autoload :Fragments, 'action_controller/caching/fragments' + autoload :Pages, 'action_controller/caching/pages' + autoload :SqlCache, 'action_controller/caching/sql_cache' + autoload :Sweeping, 'action_controller/caching/sweeping' + def self.included(base) #:nodoc: base.class_eval do @@cache_store = nil @@ -63,10 +62,9 @@ module ActionController #:nodoc: end end - - private + private def cache_configured? self.class.cache_configured? end end -end
\ No newline at end of file +end |