Convert #find_or_create_by_x to #where().first_or_create

MSP-12016
bug/bundler_fix
Christian Catalan 2015-01-29 13:46:54 -06:00
parent dda87667c9
commit 797b5d0d55
2 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ module Msf::DBManager::Vuln
sname = opts[:proto] sname = opts[:proto]
end 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 end
# Try to find an existing vulnerability with the same service & references # 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) def add_workspace(name)
::ActiveRecord::Base.connection_pool.with_connection { ::ActiveRecord::Base.connection_pool.with_connection {
::Mdm::Workspace.find_or_create_by_name(name) ::Mdm::Workspace.where(name: name).first_or_create
} }
end end