FIX: Make Discourse.redis change backwards compatible

25ea0b3a broke docker manager when it was run against earlier versions
of Discourse, this attempts to work around the issue by introducing
the method if it is missing.
This commit is contained in:
Sam Saffron 2019-12-06 13:23:54 +11:00
parent 57f3864e7a
commit 1356552674
1 changed files with 10 additions and 0 deletions

View File

@ -6,6 +6,16 @@
# authors: Robin Ward, Sam Saffron
# url: https://github.com/discourse/docker_manager
if !defined? ::Discourse.redis
# HACK: make Discourse.redis work on old versions of Discourse
module ::Discourse
def self.redis
$redis # rubocop:disable Style/GlobalVars
end
end
end
module ::DockerManager
# should be automatic, but something is weird
load File.expand_path(File.dirname(__FILE__)) + '/app/helpers/application_helper.rb'