lib/cachable.rb in cobregratis-0.1.0 vs lib/cachable.rb in cobregratis-0.2.1
- old
+ new
@@ -62,16 +62,16 @@
cache_store.fetch(cache_key(path), cache_options) {get_without_cache(path, headers)}
end
alias_method_chain :get, :cache
def put_with_cache(path, body = '', headers = {})
- cache_store.delete(cache_key(path))
+ cache_store.delete(cache_key(path)) if is_caching?
put_without_cache(path, body, headers)
end
alias_method_chain :put, :cache
def delete_with_cache(path, headers = {})
- cache_store.delete(cache_key(path))
+ cache_store.delete(cache_key(path)) if is_caching?
delete_without_cache(path, headers)
end
alias_method_chain :delete, :cache
def cache_key(*args)