Skip to content
Browse files

Fix typo in count_by_sql documentation #1969 [Alexey Verkhovsky]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2007 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent f44dac8 commit e17bf81823454f490f4df972b570dd54d509e386 @jamis jamis committed Aug 14, 2005
Showing with 3 additions and 1 deletion.
  1. +2 −0 activerecord/CHANGELOG
  2. +1 −1 activerecord/lib/active_record/base.rb
View
2 activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Fix typo in count_by_sql documentation #1969 [Alexey Verkhovsky]
+
* Allow add_column and create_table to specify NOT NULL #1712 [emptysands@gmail.com]
* Fix create_table so that id column is implicitly added [Rick Olson]
View
2 activerecord/lib/active_record/base.rb
@@ -458,7 +458,7 @@ def count(conditions = nil, joins = nil)
end
# Returns the result of an SQL statement that should only include a COUNT(*) in the SELECT part.
- # Product.count "SELECT COUNT(*) FROM sales s, customers c WHERE s.customer_id = c.id"
+ # Product.count_by_sql "SELECT COUNT(*) FROM sales s, customers c WHERE s.customer_id = c.id"
def count_by_sql(sql)
sql = sanitize_conditions(sql)
rows = connection.select_one(sql, "#{name} Count")

0 comments on commit e17bf81

Please sign in to comment.
Something went wrong with that request. Please try again.