Fix crash when database.yml doesn't exist

bug/bundler_fix
James Lee 2014-08-18 12:40:57 -05:00
parent 7c1605efe4
commit b9e449f5e2
No known key found for this signature in database
GPG Key ID: 2D6094C7CEA0A321
1 changed files with 7 additions and 3 deletions

View File

@ -49,10 +49,14 @@ module Metasploit
# #
# @return [void] # @return [void]
def self.optionally_active_record_railtie def self.optionally_active_record_railtie
optionally( if ::File.exist?(Rails.application.config.paths['config/database'].first)
optionally(
'active_record/railtie', 'active_record/railtie',
'activerecord not in the bundle, so database support will be disabled.' 'activerecord not in the bundle, so database support will be disabled.'
) )
else
warn 'Could not find database.yml, so database support will be disabled.'
end
end end
# Tries to `require 'metasploit/credential/creation'` and include it in the `including_module`. # Tries to `require 'metasploit/credential/creation'` and include it in the `including_module`.