Skip to content

Commit

Permalink
Use #distinct instead of #uniq in the guides [ci skip] (#25098)
Browse files Browse the repository at this point in the history
* #uniq will be deprecated, see: adfab2d
  • Loading branch information
juno authored and rafaelfranca committed May 21, 2016
1 parent e530534 commit 3c557cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion guides/source/active_record_querying.md
Expand Up @@ -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:
Expand Down

0 comments on commit 3c557cb

Please sign in to comment.