From 011a2091749f0b58a3233aeff5bfca67e5f7bfae Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 16 Oct 2007 22:24:55 +0000 Subject: 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 --- actionpack/lib/action_controller/caching.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_controller/caching.rb') 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 -- cgit v1.2.3