From fcf8ec90ca259fe75b9e89ee3b121c9387ef50f6 Mon Sep 17 00:00:00 2001 From: Caitlin Date: Fri, 17 Jan 2025 12:33:37 -0500 Subject: [PATCH 1/2] remove db & configuration table check as it is now done in dradis-plugins --- lib/dradis/plugins/calculators/dread/engine.rb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/dradis/plugins/calculators/dread/engine.rb b/lib/dradis/plugins/calculators/dread/engine.rb index 9aae6ee..bae93f1 100644 --- a/lib/dradis/plugins/calculators/dread/engine.rb +++ b/lib/dradis/plugins/calculators/dread/engine.rb @@ -24,17 +24,15 @@ class Engine < ::Rails::Engine # By default, this engine is loaded into the main app. So, upon app # initialization, we first check if the DB is loaded and the Configuration # table has been created, before checking if the engine is enabled - Rails.application.reloader.to_prepare do - if (ActiveRecord::Base.connection rescue false) && ::Configuration.table_exists? - Rails.application.routes.append do - # Enabling/disabling integrations calls Rails.application.reload_routes! we need the enable - # check inside the block to ensure the routes can be re-enabled without a server restart - if Engine.enabled? - mount Engine => '/', as: :dread_calculator - end + # Rails.application.reloader.to_prepare do + Rails.application.routes.append do + # Enabling/disabling integrations calls Rails.application.reload_routes! we need the enable + # check inside the block to ensure the routes can be re-enabled without a server restart + if Engine.enabled? + mount Engine => '/', as: :dread_calculator end end - end + # end end end end From ba78f9630042a56ecfef165ca60319afa1f6f698 Mon Sep 17 00:00:00 2001 From: Caitlin Date: Fri, 17 Jan 2025 12:45:07 -0500 Subject: [PATCH 2/2] remove outdated comment --- lib/dradis/plugins/calculators/dread/engine.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/dradis/plugins/calculators/dread/engine.rb b/lib/dradis/plugins/calculators/dread/engine.rb index bae93f1..0abd716 100644 --- a/lib/dradis/plugins/calculators/dread/engine.rb +++ b/lib/dradis/plugins/calculators/dread/engine.rb @@ -21,10 +21,6 @@ class Engine < ::Rails::Engine end initializer 'calculator_dread.mount_engine' do - # By default, this engine is loaded into the main app. So, upon app - # initialization, we first check if the DB is loaded and the Configuration - # table has been created, before checking if the engine is enabled - # Rails.application.reloader.to_prepare do Rails.application.routes.append do # Enabling/disabling integrations calls Rails.application.reload_routes! we need the enable # check inside the block to ensure the routes can be re-enabled without a server restart