Sha256: 3864833da412e0d9920c26498cae55abb684e11580d77fbf544d613b66e5fb41

Contents?: true

Size: 425 Bytes

Versions: 2

Compression:

Stored size: 425 Bytes

Contents

begin
  require "redis"
rescue LoadError
end

class Redis

  alias :set_without_cached_record :set
  def set(key, value, ttl_or_options = nil)
    if ttl_or_options.is_a? Integer
      ttl = ttl_or_options
      options = {}
    else
      options = ttl_or_options || {}
    end
    set_without_cached_record(key, value, options).tap do
      expire key, ttl if ttl
    end
  end

  def delete(*args)
    del *args
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cached_record-0.1.1 lib/gem_ext/redis.rb
cached_record-0.1.0 lib/gem_ext/redis.rb