Skip to content

Commit

Permalink
Adding exist to cache api. It's a bad idea that is changed in Rails e…
Browse files Browse the repository at this point in the history
…dge, but this is mirroring how it works in 3.0.1.
  • Loading branch information
benhutton committed Nov 11, 2010
1 parent 66e9781 commit 974ad04
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/interlock/action_controller.rb
Expand Up @@ -225,7 +225,14 @@ def read_fragment(key, options = nil)
raise e
end
end


def fragment_exist?(key, options = nil)
return unless perform_caching

instrument_fragment_cache :exist_fragment?, key do
cache_store.exist?(key, options)
end
end
end

# With Rails 2.1 action caching, we need to slip in our :expire param into the ActionCacheFilter options, so that when we
Expand Down
4 changes: 4 additions & 0 deletions lib/interlock/config.rb
Expand Up @@ -129,6 +129,10 @@ def write(name, content, options = {})
content,
options.is_a?(Hash) ? options[:ttl] : Interlock.config[:ttl] )
end

def exist?(*args)
read(*args)
end
end
end

Expand Down

0 comments on commit 974ad04

Please sign in to comment.