From 959a36084a75ed9d256276995dc3d3c433bc39e7 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Thu, 31 May 2012 10:07:43 -0300 Subject: Fix wrong example for count method with block [ci skip] Thanks @splattael. --- activerecord/lib/active_record/relation/calculations.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/relation/calculations.rb') diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb index ad49c80e4f..54c93332bb 100644 --- a/activerecord/lib/active_record/relation/calculations.rb +++ b/activerecord/lib/active_record/relation/calculations.rb @@ -17,7 +17,7 @@ module ActiveRecord # Person.count(:age, distinct: true) # # => counts the number of different age values # - # Person.where("age > 26").count { |person| gender == 'female' } + # Person.where("age > 26").count { |person| person.gender == 'female' } # # => queries people where "age > 26" then count the loaded results filtering by gender def count(column_name = nil, options = {}) if block_given? -- cgit v1.2.3