Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove configuration table check as it is now done in dradis-plugins #61

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions lib/dradis/plugins/calculators/cvss/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,12 @@ class Engine < ::Rails::Engine
end

initializer 'calculator_cvss.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
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: :cvss_calculator
end
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: :cvss_calculator
end
end
end
Expand Down