File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ def self.optionally(name, without_warning)
49
49
#
50
50
# @return [void]
51
51
def self . optionally_active_record_railtie
52
- if ::File . exist? ( Rails . application . config . paths [ 'config/database' ] . first )
52
+ if ::Rails . application . config . paths [ 'config/database' ] . any?
53
53
optionally (
54
54
'active_record/railtie' ,
55
55
'activerecord not in the bundle, so database support will be disabled.'
Original file line number Diff line number Diff line change 11
11
# Must be explicit as activerecord is optional dependency
12
12
require 'active_record/railtie'
13
13
14
+ require 'metasploit/framework/database'
15
+ # check if database.yml is present
16
+ unless Metasploit ::Framework ::Database . configurations_pathname . try ( :to_path )
17
+ fail 'RSPEC currently needs a configured database'
18
+ end
19
+
14
20
require File . expand_path ( '../../config/environment' , __FILE__ )
15
21
16
22
# Don't `require 'rspec/rails'` as it includes support for pieces of rails that metasploit-framework doesn't use
You can’t perform that action at this time.
0 commit comments