diff options
author | Junya Ogura <junyaogura@gmail.com> | 2016-05-21 23:06:34 +0900 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2016-05-21 11:06:34 -0300 |
commit | 3c557cb33327d2220195ad19db442875748f90a3 (patch) | |
tree | 9c3edd83327191602933c40972e3b77e99fa1b32 | |
parent | e530534265d2c32b5c5f772e81cb9002dcf5e9cf (diff) | |
download | rails-3c557cb33327d2220195ad19db442875748f90a3.tar.gz rails-3c557cb33327d2220195ad19db442875748f90a3.tar.bz2 rails-3c557cb33327d2220195ad19db442875748f90a3.zip |
Use #distinct instead of #uniq in the guides [ci skip] (#25098)
* #uniq will be deprecated, see: rails/rails@adfab2d
-rw-r--r-- | guides/source/active_record_querying.md | 2 |
1 files changed, 1 insertions, 1 deletions
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: |