diff options
Diffstat (limited to 'actionpack/lib/action_controller/caching/sql_cache.rb')
-rw-r--r-- | actionpack/lib/action_controller/caching/sql_cache.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/caching/sql_cache.rb b/actionpack/lib/action_controller/caching/sql_cache.rb new file mode 100644 index 0000000000..139be6100d --- /dev/null +++ b/actionpack/lib/action_controller/caching/sql_cache.rb @@ -0,0 +1,18 @@ +module ActionController #:nodoc: + module Caching + module SqlCache + def self.included(base) #:nodoc: + if defined?(ActiveRecord) && ActiveRecord::Base.respond_to?(:cache) + base.alias_method_chain :perform_action, :caching + end + end + + protected + def perform_action_with_caching + ActiveRecord::Base.cache do + perform_action_without_caching + end + end + end + end +end
\ No newline at end of file |