Update mock_redis.

This commit is contained in:
evazion
2020-06-18 22:07:43 -05:00
parent ae7fc7d1bc
commit 491a53ffe3
2 changed files with 2 additions and 3 deletions

View File

@@ -221,7 +221,7 @@ GEM
minitest (>= 5.0) minitest (>= 5.0)
ruby-progressbar ruby-progressbar
mocha (1.11.2) mocha (1.11.2)
mock_redis (0.23.0) mock_redis (0.24.0)
msgpack (1.3.3) msgpack (1.3.3)
msgpack (1.3.3-x64-mingw32) msgpack (1.3.3-x64-mingw32)
multi_json (1.14.1) multi_json (1.14.1)

View File

@@ -18,8 +18,7 @@ class SavedSearch < ApplicationRecord
post_ids = Set.new post_ids = Set.new
queries.each do |query| queries.each do |query|
redis_key = "search:#{query}" redis_key = "search:#{query}"
# XXX change to `exists?` (ref: https://github.com-sds/mock_redis/pull/188 if redis.exists?(redis_key)
if redis.exists(redis_key)
sub_ids = redis.smembers(redis_key).map(&:to_i) sub_ids = redis.smembers(redis_key).map(&:to_i)
post_ids.merge(sub_ids) post_ids.merge(sub_ids)
else else