diff options
author | Yasuo Honda <yasuo.honda@gmail.com> | 2017-09-13 18:34:50 +0000 |
---|---|---|
committer | Yasuo Honda <yasuo.honda@gmail.com> | 2017-09-13 22:55:13 +0000 |
commit | aaed081e08c1a04eabeec9fa5edab5e0760f46e2 (patch) | |
tree | 2d1ccc24366dc44716b8cf9da4a77ff6285d99fd /activerecord/test/models/interest.rb | |
parent | 7d5399379cb9ac2d3ffafa28fdc844d7b6c18ab8 (diff) | |
download | rails-aaed081e08c1a04eabeec9fa5edab5e0760f46e2.tar.gz rails-aaed081e08c1a04eabeec9fa5edab5e0760f46e2.tar.bz2 rails-aaed081e08c1a04eabeec9fa5edab5e0760f46e2.zip |
Address random `test_or_with_bind_params` failures
Reported at https://travis-ci.org/rails/rails/jobs/274370258
- `Post.find([1, 2])` generates this query below:
```sql
SELECT "posts".* FROM "posts" WHERE "posts"."id" IN ($1, $2) [["id", 1], ["id", 2]]
```
- `Post.where(id: 1).or(Post.where(id: 2)).to_a` generates this query below:
```sql
SELECT "posts".* FROM "posts" WHERE ("posts"."id" = $1 OR "posts"."id" = $2) [["id", 1], ["id", 2]]
```
Most of the time these two queries return the same result but the order of records are not guaranteed
from SQL point of view then added `sort` before comparing them.
Diffstat (limited to 'activerecord/test/models/interest.rb')
0 files changed, 0 insertions, 0 deletions