提交 8219db5e 编写于 作者: R Rick Olson

rollback [5833] and [5835]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5838 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 1023bc6e
*SVN*
* 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]
* Set session to an empty hash if :new_session => false and no session cookie or param is present. CGI::Session was raising an unrescued ArgumentError. [Josh Susser]
......
......@@ -307,16 +307,16 @@ module Fragments
def self.included(base) #:nodoc:
base.class_eval do
@@fragment_cache_store = MemoryStore.new
cattr_writer :fragment_cache_store
cattr_reader :fragment_cache_store
def self.fragment_cache_store
@@fragment_cache_store = if @@fragment_cache_store.is_a?(Array)
store, *parameters = *([ @@fragment_cache_store ].flatten)
def self.fragment_cache_store=(store_option)
store, *parameters = *([ store_option ].flatten)
@@fragment_cache_store = if store.is_a?(Symbol)
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
@@fragment_cache_store
store
end
end
end
......
......@@ -18,13 +18,13 @@ module ClassMethods
# file system, but you can also specify one of the other included stores (:active_record_store, :drb_store,
# :mem_cache_store, or :memory_store) or use your own class.
def session_store=(store)
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] = store
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] =
store.is_a?(Symbol) ? CGI::Session.const_get(store == :drb_store ? "DRbStore" : store.to_s.camelize) : store
end
# Returns the session store class currently used.
def session_store
store = ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager]
self.session_store = store.is_a?(Symbol) ? CGI::Session.const_get(store == :drb_store ? "DRbStore" : store.to_s.camelize) : store
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager]
end
# Returns the hash used to configure the session. Example use:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册