aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-01-04 21:31:18 +0000
committerRick Olson <technoweenie@gmail.com>2007-01-04 21:31:18 +0000
commit1023bc6e8622e2d5c2683764d25f543d5e79a926 (patch)
treeeb2b58c9366a11d8dd0550071a955c54a9928743
parent05aa57bc8439d5fa769cb8a486233c455f93857c (diff)
downloadrails-1023bc6e8622e2d5c2683764d25f543d5e79a926.tar.gz
rails-1023bc6e8622e2d5c2683764d25f543d5e79a926.tar.bz2
rails-1023bc6e8622e2d5c2683764d25f543d5e79a926.zip
Allow ActionController::Base.session_store and #fragment_cache_store to lazily load the session class to allow for custom session store plugins. [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5835 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--actionpack/CHANGELOG2
-rw-r--r--actionpack/lib/action_controller/caching.rb10
2 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index 2e248e944b..e04dcb4631 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,6 +1,6 @@
*SVN*
-* Allow ActionController::Base.session_store to lazily load the session class to allow for custom session store plugins. [Rick Olson]
+* Allow ActionController::Base.session_store and #fragment_cache_store to lazily load the session class to allow for custom session store plugins. [Rick Olson]
* Make sure html_document is reset between integration test requests. [ctm]
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb
index c7f3e95617..39c57206e7 100644
--- a/actionpack/lib/action_controller/caching.rb
+++ b/actionpack/lib/action_controller/caching.rb
@@ -307,16 +307,16 @@ module ActionController #:nodoc:
def self.included(base) #:nodoc:
base.class_eval do
@@fragment_cache_store = MemoryStore.new
- cattr_reader :fragment_cache_store
+ cattr_writer :fragment_cache_store
- def self.fragment_cache_store=(store_option)
- store, *parameters = *([ store_option ].flatten)
- @@fragment_cache_store = if store.is_a?(Symbol)
+ def self.fragment_cache_store
+ @@fragment_cache_store = if @@fragment_cache_store.is_a?(Array)
+ store, *parameters = *([ @@fragment_cache_store ].flatten)
store_class_name = (store == :drb_store ? "DRbStore" : store.to_s.camelize)
store_class = ActionController::Caching::Fragments.const_get(store_class_name)
store_class.new(*parameters)
else
- store
+ @@fragment_cache_store
end
end
end