aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/caching/actions.rb
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-05-02 03:21:40 -0300
committerEmilio Tagua <miloops@gmail.com>2009-05-02 03:21:40 -0300
commit5e790d368c5d0e89cfd5ef1245e4b131be63716f (patch)
treefe26ed0a2b3056dd67fe46558abd96712cef67d5 /actionpack/lib/action_controller/caching/actions.rb
parent9f36431f58c406312d0b0317543b7f69107e61e9 (diff)
parent3be3470fab788856b4559742434f195cc6b1009a (diff)
downloadrails-5e790d368c5d0e89cfd5ef1245e4b131be63716f.tar.gz
rails-5e790d368c5d0e89cfd5ef1245e4b131be63716f.tar.bz2
rails-5e790d368c5d0e89cfd5ef1245e4b131be63716f.zip
Merge commit 'rails/master'
Diffstat (limited to 'actionpack/lib/action_controller/caching/actions.rb')
-rw-r--r--actionpack/lib/action_controller/caching/actions.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/caching/actions.rb b/actionpack/lib/action_controller/caching/actions.rb
index d95a346862..2b822b52c8 100644
--- a/actionpack/lib/action_controller/caching/actions.rb
+++ b/actionpack/lib/action_controller/caching/actions.rb
@@ -61,7 +61,9 @@ module ActionController #:nodoc:
filter_options = { :only => actions, :if => options.delete(:if), :unless => options.delete(:unless) }
cache_filter = ActionCacheFilter.new(:layout => options.delete(:layout), :cache_path => options.delete(:cache_path), :store_options => options)
- around_filter(cache_filter, filter_options)
+ around_filter(filter_options) do |controller, action|
+ cache_filter.filter(controller, action)
+ end
end
end
@@ -83,6 +85,12 @@ module ActionController #:nodoc:
@options = options
end
+ def filter(controller, action)
+ should_continue = before(controller)
+ action.call if should_continue
+ after(controller)
+ end
+
def before(controller)
cache_path = ActionCachePath.new(controller, path_options_for(controller, @options.slice(:cache_path)))
if cache = controller.read_fragment(cache_path.path, @options[:store_options])