From 0fa0e7fd53f228e6bb760a8f041e4aeb3dd2ac1a Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Thu, 13 Jun 2019 16:33:03 +1000 Subject: [PATCH] DEV: support running plugin without db This is required for asset precompile --- plugin.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin.rb b/plugin.rb index 3000b04..c57d2cc 100644 --- a/plugin.rb +++ b/plugin.rb @@ -25,8 +25,10 @@ after_initialize do '../app/serializers/concerns/topic_answer_mixin.rb' ].each { |path| load File.expand_path(path, __FILE__) } + skip_db = defined?(GlobalSetting.skip_db?) && GlobalSetting.skip_db? + # we got to do a one time upgrade - if defined?(UserAction::SOLVED) + if !skip_db && defined?(UserAction::SOLVED) unless $redis.get('solved_already_upgraded') unless UserAction.where(action_type: UserAction::SOLVED).exists? Rails.logger.info("Upgrading storage for solved")