From df53900b1322c508279842f6f86acccd3d0187ca Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 11 Feb 2021 02:11:30 +0100 Subject: [PATCH] Fix obsolete digitalocean.rake file breaking rake tasks (#15618) --- config/application.rb | 1 + lib/rails/engine_extensions.rb | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 lib/rails/engine_extensions.rb diff --git a/config/application.rb b/config/application.rb index 696dc17e66..a45ac18601 100644 --- a/config/application.rb +++ b/config/application.rb @@ -25,6 +25,7 @@ require_relative '../lib/devise/two_factor_pam_authenticatable' require_relative '../lib/chewy/strategy/custom_sidekiq' require_relative '../lib/webpacker/manifest_extensions' require_relative '../lib/webpacker/helper_extensions' +require_relative '../lib/rails/engine_extensions' Dotenv::Railtie.load diff --git a/lib/rails/engine_extensions.rb b/lib/rails/engine_extensions.rb new file mode 100644 index 0000000000..4848b15f25 --- /dev/null +++ b/lib/rails/engine_extensions.rb @@ -0,0 +1,11 @@ +module Rails + module EngineExtensions + # Rewrite task loading code to filter digitalocean.rake task + def run_tasks_blocks(app) + Railtie.instance_method(:run_tasks_blocks).bind(self).call(app) + paths["lib/tasks"].existent.reject { |ext| ext.end_with?('digitalocean.rake') }.sort.each { |ext| load(ext) } + end + end +end + +Rails::Engine.prepend(Rails::EngineExtensions)