aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-04-13 05:40:22 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-04-13 05:40:22 +0000
commitad24c6d756f1fb0f78028f19b7922cc5490d5d74 (patch)
treee81dbd467fbec09ee66a97b5b852bbd5b7edc36d /activerecord/lib/active_record
parent7f558cbd05535f80dfb56198c803df09896c202b (diff)
downloadrails-ad24c6d756f1fb0f78028f19b7922cc5490d5d74.tar.gz
rails-ad24c6d756f1fb0f78028f19b7922cc5490d5d74.tar.bz2
rails-ad24c6d756f1fb0f78028f19b7922cc5490d5d74.zip
Fixed pagination to work with joins #1034 [scott@sigkill.org]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1159 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record')
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 7ef6532e52..841940897a 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -415,7 +415,7 @@ module ActiveRecord #:nodoc:
# Returns the number of records that meets the +conditions+. Zero is returned if no records match. Example:
# Product.count "sales > 1"
def count(conditions = nil, joins = nil)
- tbl_var_name = joins ? table_name[0,1].downcase : ""
+ tbl_var_name = joins ? table_name[0,1].downcase : ""
sql = "SELECT COUNT(*) FROM #{table_name} #{tbl_var_name} "
sql << ", #{joins} " if joins
add_conditions!(sql, conditions)