Land #4697, updates to finder syntax

Updates some Rails 3 style ActiveRecord calls to use the Rails 4 Arel
syntax, in preparation for our move to Rails 4.

Fixes #4697, also see MSP-12016
bug/bundler_fix
Matt Buck 2015-02-06 15:41:11 -06:00
commit 531743eff1
No known key found for this signature in database
GPG Key ID: 42134E0C9C4E94BB
2 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ module Msf::DBManager::Vuln
sname = opts[:proto]
end
service = host.services.find_or_create_by_port_and_proto(opts[:port].to_i, proto)
service = host.services.where(port: opts[:port].to_i, proto: proto).first_or_create
end
# Try to find an existing vulnerability with the same service & references

View File

@ -4,7 +4,7 @@ module Msf::DBManager::Workspace
#
def add_workspace(name)
::ActiveRecord::Base.connection_pool.with_connection {
::Mdm::Workspace.find_or_create_by_name(name)
::Mdm::Workspace.where(name: name).first_or_create
}
end