lib/redis-model-extension.rb in redis-model-extension-0.3.1 vs lib/redis-model-extension.rb in redis-model-extension-0.3.2
- old
+ new
@@ -158,10 +158,10 @@
end
#if you know redis key and would like to get object
def get_by_redis_key(redis_key)
if redis_key.is_a?(String) && Database.redis.exists(redis_key)
- if redis_key.include?("*")
+ unless redis_key.include?("*")
data_args = Database.redis.hgetall(redis_key)
klass.new(data_args.merge({:old_args => data_args}))
else
raise ArgumentError, "RedisKey for method get_by_redis_key can not contains '*'"
end
\ No newline at end of file