Add where condition so select_one returns the correct record.
Merge pull request #16318 from zuhao/refactor_activerecord_adapter_test

make `adapter_test` run order independently.