Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

More Rails 3 fixes, removing puts

  • Loading branch information...
commit 6c73844bc7752a6e362a6fbcd6f4ba3e9d16f2d4 1 parent 2b73c5d
Winton Welsh authored
Showing with 4 additions and 6 deletions.
  1. +0 −2  lib/background_cache.rb
  2. +4 −4 lib/background_cache/helper.rb
2  lib/background_cache.rb
View
@@ -44,8 +44,6 @@ def self.attach!
::Dalli::Client.send(:include, BackgroundCache::Memcache) if defined?(::Dalli::Client)
::MemCache.send(:include, BackgroundCache::Memcache) if defined?(::MemCache)
::Memcached::Rails.send(:include, BackgroundCache::Memcache) if defined?(::Memcached::Rails)
-
- puts "ATTACH!"
end
def self.cache!(group=nil, instance=nil)
8 lib/background_cache/helper.rb
View
@@ -10,13 +10,13 @@ def cache_with_background_cache(name = {}, options = nil, &block)
# ActionController::Caching::Fragments#fragment_for (undocumented)
# actionpack/lib/action_controller/caching/fragments.rb
perform_caching =
- if @controller.respond_to?(:perform_caching)
- @controller.perform_caching
+ if controller.respond_to?(:perform_caching)
+ controller.perform_caching
else
ActionController::Base.perform_caching
end
if perform_caching
- cache = @controller.read_fragment(name, options)
+ cache = controller.read_fragment(name, options)
match = (
BackgroundCache.active? &&
BackgroundCache.match?(name)
@@ -28,7 +28,7 @@ def cache_with_background_cache(name = {}, options = nil, &block)
"<!-- #{name.inspect}#{' background' if match} cached #{Time.now.strftime("%m/%d/%Y at %I:%M %p")} -->",
output_buffer[pos..-1]
].join("\n")
- @controller.write_fragment(name, output, options)
+ controller.write_fragment(name, output, options)
else
output_buffer.concat(cache)
end
Please sign in to comment.
Something went wrong with that request. Please try again.