mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
2a9ad9ccbc
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8546 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
18 lines
No EOL
448 B
Ruby
18 lines
No EOL
448 B
Ruby
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 |