Fixed a bug in  when using has_many association with :inverse_of option and UUID primary key.

Closes #10450.

When using UUID primary key and has_many with :inverse_of option, the following error is occurred.

```
ActiveRecord::RecordNotFound: Couldn't find Comment with id=["bca2decc-51e4-4e58-b45b-6afae21c2168"] [WHERE "comments"."post_id" = $1]
```

The cause of problem was we assumed integer id in ActiveRecord::Associations::CollectionAssociation#find_by_scan.