diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-11 02:11:24 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-11 02:11:24 +0000 |
commit | 2182a8203ff4c7b3d4fc36d59961a73d591f5e6b (patch) | |
tree | 45a5c3e04efceba7c60a62f94d756dab7f8d0ed7 | |
parent | efdabfb8f5b6d62bbd2455d5230b1d3f72219380 (diff) | |
download | rails-2182a8203ff4c7b3d4fc36d59961a73d591f5e6b.tar.gz rails-2182a8203ff4c7b3d4fc36d59961a73d591f5e6b.tar.bz2 rails-2182a8203ff4c7b3d4fc36d59961a73d591f5e6b.zip |
Tweaks and tinkering
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@390 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | actionpack/lib/action_controller/caching.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb index ee606ce13d..ef9cf37589 100644 --- a/actionpack/lib/action_controller/caching.rb +++ b/actionpack/lib/action_controller/caching.rb @@ -120,7 +120,13 @@ module ActionController #:nodoc: end def expire_action(options = {}) - expire_fragment(url_for(options).split("://").last) + if options[:action].is_a?(Array) + options[:action].dup.each do |action| + expire_fragment(url_for(options.merge({ :action => action })).split("://").last) + end + else + expire_fragment(url_for(options).split("://").last) + end end class ActionCacheFilter #:nodoc: @@ -182,7 +188,6 @@ module ActionController #:nodoc: def cache_erb_fragment(binding, name = {}, options = {}) buffer = eval("_erbout", binding) - name = url_for(name) if name.is_a?(Hash) if cache = read_fragment(name, options) buffer.concat(cache) else @@ -193,14 +198,14 @@ module ActionController #:nodoc: end def write_fragment(name, content, options = {}) - name = url_for(name) if name.is_a?(Hash) + name = url_for(name).split("://").last if name.is_a?(Hash) fragment_cache_store.write(name, content, options) logger.info "Cached fragment: #{name}" unless logger.nil? content end def read_fragment(name, options = {}) - name = url_for(name) if name.is_a?(Hash) + name = url_for(name).split("://").last if name.is_a?(Hash) if cache = fragment_cache_store.read(name, options) logger.info "Fragment hit: #{name}" unless logger.nil? cache @@ -210,7 +215,7 @@ module ActionController #:nodoc: end def expire_fragment(name, options = {}) - name = url_for(name) if name.is_a?(Hash) + name = url_for(name).split("://").last if name.is_a?(Hash) fragment_cache_store.delete(name, options) logger.info "Expired fragment: #{name}" unless logger.nil? end |