From 3c557cb33327d2220195ad19db442875748f90a3 Mon Sep 17 00:00:00 2001 From: Junya Ogura Date: Sat, 21 May 2016 23:06:34 +0900 Subject: Use #distinct instead of #uniq in the guides [ci skip] (#25098) * #uniq will be deprecated, see: rails/rails@adfab2d --- guides/source/active_record_querying.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/active_record_querying.md') diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index 9a13e3bda7..928ab43b3b 100644 --- a/guides/source/active_record_querying.md +++ b/guides/source/active_record_querying.md @@ -1121,7 +1121,7 @@ If you want to select a set of records whether or not they have associated records you can use the `left_outer_joins` method. ```ruby -Author.left_outer_joins(:posts).uniq.select('authors.*, COUNT(posts.*) AS posts_count').group('authors.id') +Author.left_outer_joins(:posts).distinct.select('authors.*, COUNT(posts.*) AS posts_count').group('authors.id') ``` Which produces: -- cgit v1.2.3