Skip to content

Commit d7a0c1f

Browse files
committed
Optionally require 'active_record/railtie` in Rakefile
MSP-10905 Require in Rakefile so that db tasks are defined. Make it optionally so that `rake` doesn't error out when metasploit-framework installed with `bundle install --without db`.
1 parent ceb8a0f commit d7a0c1f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Rakefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
#!/usr/bin/env rake
22
require File.expand_path('../config/application', __FILE__)
3+
require 'metasploit/framework/require'
4+
5+
# @note must be before `Metasploit::Framework::Application.load_tasks`
6+
#
7+
# define db rake tasks from activerecord if activerecord is in the bundle. activerecord could be not in the bundle if
8+
# the user installs with `bundle install --without db`
9+
Metasploit::Framework::Require.optionally_active_record_railtie
310

411
Metasploit::Framework::Application.load_tasks

0 commit comments

Comments
 (0)