I have a model class that caches data in redis. The first time I call a method on the model, it computes a JSON/Hash value and stores it in Redis. Under certain circumstances I 'flush' that data and it gets recomputed on the next call. Here's the code snippet similar to the one I use to store the data in Redis: def cache_data self.data_values = data_to_cache REDIS.set(redis_key,ActiveSupport::JSON