Active Record 3.0: Change behaviour with empty hash in where clause

This is a backport of pull #9220 to rails 3.0