aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/caching.rb
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2006-09-30 01:38:22 +0000
committerRick Olson <technoweenie@gmail.com>2006-09-30 01:38:22 +0000
commit3010e30f0ed9407e3d608e8bb4859f09cb52c14e (patch)
treedcd3e07f73875c512fc7357331cabea6ff755ca8 /actionpack/lib/action_controller/caching.rb
parent52547f53314a52de14d90befb90f4364d800671e (diff)
downloadrails-3010e30f0ed9407e3d608e8bb4859f09cb52c14e.tar.gz
rails-3010e30f0ed9407e3d608e8bb4859f09cb52c14e.tar.bz2
rails-3010e30f0ed9407e3d608e8bb4859f09cb52c14e.zip
Fixed some deprecation warnings in ActionPack [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5212 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/caching.rb')
-rw-r--r--actionpack/lib/action_controller/caching.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb
index e7782d3e22..fa45b46e05 100644
--- a/actionpack/lib/action_controller/caching.rb
+++ b/actionpack/lib/action_controller/caching.rb
@@ -135,7 +135,7 @@ module ActionController #:nodoc:
private
def caching_allowed
- !@request.post? && response.headers['Status'] && response.headers['Status'].to_i < 400
+ !request.post? && response.headers['Status'] && response.headers['Status'].to_i < 400
end
end
@@ -559,8 +559,7 @@ module ActionController #:nodoc:
return unless perform_caching
configuration = sweepers.last.is_a?(Hash) ? sweepers.pop : {}
sweepers.each do |sweeper|
- observer(sweeper)
-
+ ActiveRecord::Base.observers << sweeper if defined?(ActiveRecord) and defined?(ActiveRecord::Base)
sweeper_instance = Object.const_get(Inflector.classify(sweeper)).instance
if sweeper_instance.is_a?(Sweeper)