Changeset 5838
- Timestamp:
- 01/04/07 21:43:24 (2 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/caching.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/session_management.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r5835 r5838 1 1 *SVN* 2 3 * Allow ActionController::Base.session_store and #fragment_cache_store to lazily load the session class to allow for custom session store plugins. [Rick Olson]4 2 5 3 * Make sure html_document is reset between integration test requests. [ctm] trunk/actionpack/lib/action_controller/caching.rb
r5835 r5838 308 308 base.class_eval do 309 309 @@fragment_cache_store = MemoryStore.new 310 cattr_ writer :fragment_cache_store311 312 def self.fragment_cache_store 313 @@fragment_cache_store = if @@fragment_cache_store.is_a?(Array)314 store, *parameters = *([ @@fragment_cache_store ].flatten)310 cattr_reader :fragment_cache_store 311 312 def self.fragment_cache_store=(store_option) 313 store, *parameters = *([ store_option ].flatten) 314 @@fragment_cache_store = if store.is_a?(Symbol) 315 315 store_class_name = (store == :drb_store ? "DRbStore" : store.to_s.camelize) 316 316 store_class = ActionController::Caching::Fragments.const_get(store_class_name) 317 317 store_class.new(*parameters) 318 318 else 319 @@fragment_cache_store319 store 320 320 end 321 321 end trunk/actionpack/lib/action_controller/session_management.rb
r5833 r5838 19 19 # :mem_cache_store, or :memory_store) or use your own class. 20 20 def session_store=(store) 21 ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] = store 21 ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] = 22 store.is_a?(Symbol) ? CGI::Session.const_get(store == :drb_store ? "DRbStore" : store.to_s.camelize) : store 22 23 end 23 24 24 25 # Returns the session store class currently used. 25 26 def session_store 26 store = ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] 27 self.session_store = store.is_a?(Symbol) ? CGI::Session.const_get(store == :drb_store ? "DRbStore" : store.to_s.camelize) : store 27 ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:database_manager] 28 28 end 29 29