From edd68a587f412ccdf15613c663acbab341d45017 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 24 Jul 2007 16:48:57 +0000 Subject: Refactored in use of extract_options! (closes #9079) [josh] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7220 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/caching.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 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 75aa9df812..1b35cbe403 100644 --- a/actionpack/lib/action_controller/caching.rb +++ b/actionpack/lib/action_controller/caching.rb @@ -222,7 +222,7 @@ module ActionController #:nodoc: class ActionCacheFilter #:nodoc: def initialize(*actions, &block) - @options = actions.last.is_a?(Hash) ? actions.pop : {} + @options = actions.extract_options! @actions = Set.new actions end @@ -596,7 +596,7 @@ module ActionController #:nodoc: module ClassMethods #:nodoc: def cache_sweeper(*sweepers) return unless perform_caching - configuration = sweepers.last.is_a?(Hash) ? sweepers.pop : {} + configuration = sweepers.extract_options! sweepers.each do |sweeper| ActiveRecord::Base.observers << sweeper if defined?(ActiveRecord) and defined?(ActiveRecord::Base) sweeper_instance = Object.const_get(Inflector.classify(sweeper)).instance -- cgit v1.2.3