Verified in 5.6.1.0. Tried with this code: vm_id = '1234' query = if vm_id $evm.vmdb(:vm).where("vendor = ? and id = ?", "redhat", vm_id) else $evm.vmdb(:vm).where("vendor = ?", "redhat") end query.first and it passed.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-1634.html