Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 5835

Show
Ignore:
Timestamp:
01/04/07 21:31:18 (2 years ago)
Author:
rick
Message:

Allow ActionController::Base.session_store and #fragment_cache_store to lazily load the session class to allow for custom session store plugins. [Rick Olson]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r5833 r5835  
    11*SVN* 
    22 
    3 * Allow ActionController::Base.session_store to lazily load the session class to allow for custom session store plugins.  [Rick Olson] 
     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] 
    44 
    55* Make sure html_document is reset between integration test requests. [ctm] 
  • trunk/actionpack/lib/action_controller/caching.rb

    r5755 r5835  
    308308        base.class_eval do 
    309309          @@fragment_cache_store = MemoryStore.new 
    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
     310          cattr_writer :fragment_cache_store 
     311 
     312          def self.fragment_cache_store 
     313            @@fragment_cache_store = if @@fragment_cache_store.is_a?(Array
     314              store, *parameters = *([ @@fragment_cache_store ].flatten
    315315              store_class_name = (store == :drb_store ? "DRbStore" : store.to_s.camelize) 
    316316              store_class = ActionController::Caching::Fragments.const_get(store_class_name) 
    317317              store_class.new(*parameters) 
    318318            else 
    319               store 
     319              @@fragment_cache_store 
    320320            end 
    321321          end