diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-05-25 18:05:58 +0200 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-05-25 18:09:12 +0200 |
commit | 10085114ce7ec6bc967fa701c49ef218f666efb5 (patch) | |
tree | 865841b3f014024f5f8b8cc44462aca699b6eff1 /actionpack/lib/action_controller/caching | |
parent | 9cda410d818353a5c27cbd5df754f1d1e290927d (diff) | |
download | rails-10085114ce7ec6bc967fa701c49ef218f666efb5.tar.gz rails-10085114ce7ec6bc967fa701c49ef218f666efb5.tar.bz2 rails-10085114ce7ec6bc967fa701c49ef218f666efb5.zip |
Make Filter#filter work with around filters
Diffstat (limited to 'actionpack/lib/action_controller/caching')
-rw-r--r-- | actionpack/lib/action_controller/caching/actions.rb | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/actionpack/lib/action_controller/caching/actions.rb b/actionpack/lib/action_controller/caching/actions.rb index 430db3932f..3646ff1af9 100644 --- a/actionpack/lib/action_controller/caching/actions.rb +++ b/actionpack/lib/action_controller/caching/actions.rb @@ -63,7 +63,7 @@ module ActionController #:nodoc: cache_filter = ActionCacheFilter.new(:layout => options.delete(:layout), :cache_path => options.delete(:cache_path), :store_options => options) # TODO: Remove this once new base is swapped in. - if defined?(Http) + if defined?(ActionController::Http) around_filter cache_filter, filter_options else around_filter(filter_options) do |controller, action| @@ -92,16 +92,18 @@ module ActionController #:nodoc: end # TODO: Remove once New Base is merged - def filter(controller, action) - should_continue = before(controller) - action.call if should_continue - after(controller) - end - - def around_process_action(controller) - should_continue = before(controller) - yield if should_continue - after(controller) + if defined?(ActionController::Http) + def around_process_action(controller) + should_continue = before(controller) + yield if should_continue + after(controller) + end + else + def filter(controller, action) + should_continue = before(controller) + action.call if should_continue + after(controller) + end end def before(controller) |