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

root/trunk/actionpack/lib/action_controller/caching/sql_cache.rb

Revision 8546, 448 bytes (checked in by david, 1 year ago)

Moved the caching stores from ActionController::Caching::Fragments::* to ActiveSupport::Cache::*. If you're explicitly referring to a store, like ActionController::Caching::Fragments::MemoryStore, you need to update that reference with ActiveSupport::Cache::MemoryStore [DHH] Deprecated ActionController::Base.fragment_cache_store for ActionController::Base.cache_store [DHH] All fragment cache keys are now by default prefixed with the 'views/' namespace [DHH] Added ActiveRecord::Base.cache_key to make it easier to cache Active Records in combination with the new ActiveSupport::Cache::* libraries [DHH] Added ActiveSupport::Gzip.decompress/compress(source) as an easy wrapper for Zlib [Tobias Luetke] Included MemCache-Client to make the improved ActiveSupport::Cache::MemCacheStore work out of the box [Bob Cottrell, Eric Hodel] Added config.cache_store to environment options to control the default cache store (default is FileStore if tmp/cache is present, otherwise MemoryStore is used) [DHH]

Line 
1 module ActionController #:nodoc:
2   module Caching
3     module SqlCache
4       def self.included(base) #:nodoc:
5         if defined?(ActiveRecord) && ActiveRecord::Base.respond_to?(:cache)
6           base.alias_method_chain :perform_action, :caching
7         end
8       end
9
10       protected
11         def perform_action_with_caching
12           ActiveRecord::Base.cache do
13             perform_action_without_caching
14           end
15         end
16     end
17   end
18 end
Note: See TracBrowser for help on using the browser.