diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-16 22:24:55 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-16 22:24:55 +0000 |
commit | 011a2091749f0b58a3233aeff5bfca67e5f7bfae (patch) | |
tree | 13493338e64e25fc69b806c76e1e343ac3cbfe39 /actionpack | |
parent | 45107ecaf85b8e7cc7ec60e95a3e646ae25618ae (diff) | |
download | rails-011a2091749f0b58a3233aeff5bfca67e5f7bfae.tar.gz rails-011a2091749f0b58a3233aeff5bfca67e5f7bfae.tar.bz2 rails-011a2091749f0b58a3233aeff5bfca67e5f7bfae.zip |
caches_page uses a single after_filter instead of one per action. Closes #9891.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7949 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rw-r--r-- | actionpack/lib/action_controller/caching.rb | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index a8211f5020..76b1a530e4 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* caches_page uses a single after_filter instead of one per action. #9891 [lifofifo] + * Update Prototype to 1.6.0_rc1 and script.aculo.us to 1.8.0 preview 0. [sam, madrobby] * Dispatcher: fix that to_prepare should only run once in production. #9889 [Nathaniel Talbott] diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb index 9ca0fa53df..3c2202e038 100644 --- a/actionpack/lib/action_controller/caching.rb +++ b/actionpack/lib/action_controller/caching.rb @@ -100,9 +100,8 @@ module ActionController #:nodoc: # matches the triggering url. def caches_page(*actions) return unless perform_caching - actions.each do |action| - class_eval "after_filter { |c| c.cache_page if c.action_name == '#{action}' }" - end + actions = actions.map(&:to_s) + after_filter { |c| c.cache_page if actions.include?(c.action_name) } end private |