guilleiguaran/fakeredis

Missing method []= with real Redis

lserman opened this issue · 2 comments

Fakeredis provides []= as an alias of set, but real Redis does not respond to []=:

Redis::CommandError (ERR unknown command '[]='):
vendor/bundle/ruby/2.4.0/gems/redis-4.0.1/lib/redis/client.rb:119:in `call'
vendor/bundle/ruby/2.4.0/gems/redis-4.0.1/lib/redis.rb:2764:in `block in method_missing'
vendor/bundle/ruby/2.4.0/gems/redis-4.0.1/lib/redis.rb:45:in `block in synchronize'
vendor/bundle/ruby/2.4.0/gems/redis-4.0.1/lib/redis.rb:45:in `synchronize'
vendor/bundle/ruby/2.4.0/gems/redis-4.0.1/lib/redis.rb:2763:in `method_missing'

can you send a PR fixing this? <3

Hello guys,
By deleting this thing, you have broken specs for several applications/gems using I18n gem.

I18n KeyValue backend method #store_translations relies on this:
@store[key] = value
where @store = Redis.new

https://github.com/ruby-i18n/i18n/blob/f59c50fd56dbccad1b0a39d787cd5079dff70d4a/lib/i18n/backend/key_value.rb#L100

I do not know what might be the solution but deleting it wasn't maybe the right one.