DEV: s/\$redis/Discourse\.redis (#8431)

This commit also adds a rubocop rule to prevent global variables.
This commit is contained in:
Joffrey JAFFEUX
2019-12-03 10:05:53 +01:00
committed by GitHub
parent 9eccfb7b52
commit 0d3d2c43a0
118 changed files with 378 additions and 362 deletions

View File

@ -143,7 +143,7 @@ describe Middleware::AnonymousCache::Helper do
# depends on i7z implementation, but lets assume it is stable unless we discover
# otherwise
expect($redis.get(helper.cache_key_body).length).to eq(16)
expect(Discourse.redis.get(helper.cache_key_body).length).to eq(16)
end
it "handles brotli switching" do

View File

@ -264,7 +264,7 @@ describe Middleware::RequestTracker do
User.where(id: -100).pluck(:id)
end
redis_calls.times do
$redis.get("x")
Discourse.redis.get("x")
end
result
end