From 91265cad77c6f341f08cc9da0c35b852f1ff3b34 Mon Sep 17 00:00:00 2001 From: Ben Passmore Date: Tue, 8 Oct 2019 16:18:21 +1000 Subject: [PATCH] Updated migrations to use ActiveRecord --- core/main/migration.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core/main/migration.rb b/core/main/migration.rb index 589f52743..ca2a6d968 100644 --- a/core/main/migration.rb +++ b/core/main/migration.rb @@ -27,14 +27,10 @@ module Core def update_commands! config = BeEF::Core::Configuration.instance - db_modules = [] - BeEF::Core::Models::CommandModule.all.each do |mod| - db_modules << mod.name - end + db_modules = BeEF::Core::Models::CommandModule.all.pluck(:name) config.get('beef.module').each do |k, v| - h = { :name => k, :path => "#{v['path']}module.rb" } - BeEF::Core::Models::CommandModule.new(h).save unless db_modules.include? k + BeEF::Core::Models::CommandModule.new(name: k, path: "#{v['path']}module.rb").save! unless db_modules.include? k end BeEF::Core::Models::CommandModule.all.each do |mod|