From 63c7ea70173d283415176611b1c463c0189f2d8b Mon Sep 17 00:00:00 2001 From: Senya Date: Thu, 9 Nov 2017 15:50:14 +0200 Subject: [PATCH 1/3] Update README.md Wrong path to example file. Also script/rails is now bin/rails. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1b99104..535698c 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ It appears in the top menu. Example of Sidekiq worker. ``` -./plugins/redmine_sidekiq/workers/sandbox_worker.rb +./plugins/redmine_sidekiq/app/workers/sandbox_worker.rb ``` ### Sandbox Web UI @@ -64,7 +64,7 @@ Enqueue, click the `perform_async(*args)` of the Jobs. Enqueue from the command line. ``` -$ script/rails runner 'SandboxWorker.perform_async' +$ bin/rails runner 'SandboxWorker.perform_async' ``` ## License From 045afb6e3600d97cd5c48341a09bb7035303010d Mon Sep 17 00:00:00 2001 From: Christophe Sourisse Date: Sun, 11 Sep 2022 14:01:44 +0200 Subject: [PATCH 2/3] Compatibility with Rails 6: zeitwerk and search path --- init.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.rb b/init.rb index 5624a8f..099d7c7 100644 --- a/init.rb +++ b/init.rb @@ -1,3 +1,5 @@ +$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/lib" + require 'redmine_sidekiq/configure' require 'redmine_sidekiq/rails' From 2e3101ae690d7c7a41929e72a803eda781986451 Mon Sep 17 00:00:00 2001 From: Christophe Sourisse Date: Sun, 11 Sep 2022 14:02:51 +0200 Subject: [PATCH 3/3] Disambiguate between vanilla "Rails" class and "redmine_sidekiq"'s Rails class This also seems to be necessary when upgrading to Rails 6. --- lib/redmine_sidekiq/configure.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/redmine_sidekiq/configure.rb b/lib/redmine_sidekiq/configure.rb index cb36ced..07fee76 100644 --- a/lib/redmine_sidekiq/configure.rb +++ b/lib/redmine_sidekiq/configure.rb @@ -7,9 +7,9 @@ module RedmineSidekiq class Configure - file = File.join(Rails.root, 'plugins/redmine_sidekiq/config/sidekiq.yml') + file = File.join(::Rails.root, 'plugins/redmine_sidekiq/config/sidekiq.yml') if File.exist?(file) - config = YAML.load_file(file)[Rails.env] + config = YAML.load_file(file)[::Rails.env] redis_conf = config['redis'].symbolize_keys end