aboutsummaryrefslogblamecommitdiffstats
path: root/actionpack/lib/action_controller/caching/sql_cache.rb
blob: 139be6100db2155aff4d8919ec5d930332ee612d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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