diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2015-11-12 22:06:07 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2015-12-19 17:38:42 +0900 |
commit | a093afd8ce6d15ea38972141f6000fe3798b6667 (patch) | |
tree | 278c52da738f16af9416051ad9d9276c99fb1585 /actionmailer/lib | |
parent | 6873db4699ac727dd27eedb0994ecdd976b40901 (diff) | |
download | rails-a093afd8ce6d15ea38972141f6000fe3798b6667.tar.gz rails-a093afd8ce6d15ea38972141f6000fe3798b6667.tar.bz2 rails-a093afd8ce6d15ea38972141f6000fe3798b6667.zip |
Fix `test_find_with_order_on_included_associations_with_construct_finder_sql_for_association_limiting_and_is_distinct` to NULL-agnostic way
The sort order of NULL depends on the RDBS implementation. This commit
is to fix the test to NULL-agnostic way.
Example:
```
activerecord_unittest=# SELECT DISTINCT "posts"."id", author_addresses_authors.id AS alias_0 FROM "posts" LEFT OUTER JOIN "authors" ON "authors"."id" = "posts"."author_id" LEFT OUTER JOIN "author_addresses" ON "author_addresses"."id" = "authors"."author_address_id" LEFT OUTER JOIN "categorizations" ON "categorizations"."category_id" = "posts"."id" LEFT OUTER JOIN "authors" "authors_posts" ON "authors_posts"."id" = "categorizations"."author_id" LEFT OUTER JOIN "author_addresses" "author_addresses_authors" ON "author_addresses_authors"."id" = "authors_posts"."author_address_id" ORDER BY author_addresses_authors.id DESC;
id | alias_0
----+---------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
1 | 1
(12 rows)
```
```
root@localhost [activerecord_unittest] > SELECT DISTINCT `posts`.`id`, author_addresses_authors.id AS alias_0 FROM `posts` LEFT OUTER JOIN `authors` ON `authors`.`id` = `posts`.`author_id` LEFT OUTER JOIN `author_addresses` ON `author_addresses`.`id` = `authors`.`author_address_id` LEFT OUTER JOIN `categorizations` ON `categorizations`.`category_id` = `posts`.`id` LEFT OUTER JOIN `authors` `authors_posts` ON `authors_posts`.`id` = `categorizations`.`author_id` LEFT OUTER JOIN `author_addresses` `author_addresses_authors` ON `author_addresses_authors`.`id` = `authors_posts`.`author_address_id` ORDER BY author_addresses_authors.id DESC;
+----+---------+
| id | alias_0 |
+----+---------+
| 1 | 1 |
| 3 | NULL |
| 1 | NULL |
| 2 | NULL |
| 4 | NULL |
| 5 | NULL |
| 6 | NULL |
| 7 | NULL |
| 8 | NULL |
| 9 | NULL |
| 10 | NULL |
| 11 | NULL |
+----+---------+
12 rows in set (0.00 sec)
```
Diffstat (limited to 'actionmailer/lib')
0 files changed, 0 insertions, 0 deletions