We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7c1605e + b9e449f commit 6792dedCopy full SHA for 6792ded
lib/metasploit/framework/require.rb
@@ -49,10 +49,14 @@ def self.optionally(name, without_warning)
49
#
50
# @return [void]
51
def self.optionally_active_record_railtie
52
- optionally(
+ if ::File.exist?(Rails.application.config.paths['config/database'].first)
53
+ optionally(
54
'active_record/railtie',
55
'activerecord not in the bundle, so database support will be disabled.'
- )
56
+ )
57
+ else
58
+ warn 'Could not find database.yml, so database support will be disabled.'
59
+ end
60
end
61
62
# Tries to `require 'metasploit/credential/creation'` and include it in the `including_module`.
@@ -89,4 +93,4 @@ def optionally_include_metasploit_credential_creation
89
93
90
94
91
95
92
-end
96
+end
0 commit comments