-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keys are not consistently converted #170
Comments
Similar problem for
|
There are also issues with using symbols as keys in Redis hashes. See below:
Note the PR to follow. |
This is addressed in PR: #173. Until this PR is merged, and a new Gem version is cut, I'm working around this in my own project with the following monkey patch. # This library is only used in test.
if Rails.env.test?
class MockRedis
module HashMethods
private
def with_hash_at(key, &blk)
version_check
with_thing_at(key.to_s, :assert_hashy, proc { {} }, &blk)
end
def version_check
return unless Gem.loaded_specs['mock_redis'].version > Gem::Version.new('0.21.0')
Rails.logger.warn 'Check if PR (https://github.com/sds/mock_redis/pull/173) is merged, and part of current ' \
'version. If so, remove this code.'
end
end
end
end |
Fixed in #173. |
When using a key in Redis, 1 and "1" are equivalent (at least in Redis 3.x). While there are a few cases where this was fixed for some methods in #157 and #48, it should be a global fix for all key access.
I've recently run into this issue for lpush and lrange. I'll look into a PR, but this is more of a notice for anyone who may be seeing this issue in their code.
The text was updated successfully, but these errors were encountered: