Skip to content

Commit

Permalink
Remove Calculations#count doc example with 0
Browse files Browse the repository at this point in the history
as a Model.group(columns).count won't return entries for combinations
that don't occur.
  • Loading branch information
duelinmarkers committed Oct 13, 2022
1 parent 08b3cc3 commit d278b1b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions activerecord/lib/active_record/relation/calculations.rb
Expand Up @@ -30,8 +30,7 @@ module Calculations
# of each key would be the #count.
#
# Article.group(:status, :category).count
# # => {["draft", "business"]=>10, ["draft", "technology"]=>4,
# # ["published", "business"]=>0, ["published", "technology"]=>2}
# # => {["draft", "business"]=>10, ["draft", "technology"]=>4, ["published", "technology"]=>2}
#
# If #count is used with {Relation#select}[rdoc-ref:QueryMethods#select], it will count the selected columns:
#
Expand Down

0 comments on commit d278b1b

Please sign in to comment.