Land #4765, Rails4 compatible finder conversion

* find_or_initialize_by_DYNAMIC
bug/bundler_fix
Samuel Huckins 2015-02-13 15:56:09 -06:00
commit ce688f4247
No known key found for this signature in database
GPG Key ID: 5FD48AA28C03C944
1 changed files with 4 additions and 4 deletions

View File

@ -166,9 +166,9 @@ module Msf::DBManager::Host
end end
if opts[:comm] and opts[:comm].length > 0 if opts[:comm] and opts[:comm].length > 0
host = wspace.hosts.find_or_initialize_by_address_and_comm(addr, opts[:comm]) host = wspace.hosts.where(address: addr, comm: opts[:comm]).first_or_initialize
else else
host = wspace.hosts.find_or_initialize_by_address(addr) host = wspace.hosts.where(address: addr).first_or_initialize
end end
else else
host = addr host = addr
@ -257,9 +257,9 @@ module Msf::DBManager::Host
end end
if opts[:comm] and opts[:comm].length > 0 if opts[:comm] and opts[:comm].length > 0
host = wspace.hosts.find_or_initialize_by_address_and_comm(addr, opts[:comm]) host = wspace.hosts.where(address: addr, comm: opts[:comm]).first_or_initialize
else else
host = wspace.hosts.find_or_initialize_by_address(addr) host = wspace.hosts.where(address: addr).first_or_initialize
end end
else else
host = addr host = addr