aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-03-06 11:53:49 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-03-06 11:53:49 +0000
commit5e44eda7872c6ee33e0d09a4b9fd78896e14b95a (patch)
treeb64009226562aa04ce107692e726f545b3f9895f /activerecord/test
parentdfac1cea3d851000116a23ab14c2b1ae981f7a12 (diff)
downloadrails-5e44eda7872c6ee33e0d09a4b9fd78896e14b95a.tar.gz
rails-5e44eda7872c6ee33e0d09a4b9fd78896e14b95a.tar.bz2
rails-5e44eda7872c6ee33e0d09a4b9fd78896e14b95a.zip
Fixed that HasManyAssociation#count was using :finder_sql rather than :counter_sql if it was available #445 [Scott Barron]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@834 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test')
-rwxr-xr-xactiverecord/test/fixtures/company.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/test/fixtures/company.rb b/activerecord/test/fixtures/company.rb
index f4df7203b8..17a71e7e20 100755
--- a/activerecord/test/fixtures/company.rb
+++ b/activerecord/test/fixtures/company.rb
@@ -6,7 +6,7 @@ end
class Firm < Company
- has_many :clients, :order => "id", :dependent => true
+ has_many :clients, :order => "id", :dependent => true, :counter_sql => "SELECT COUNT(*) FROM companies WHERE firm_id = 1 AND (type = 'Client' OR type = 'SpecialClient' OR type = 'VerySpecialClient' )"
has_many :clients_sorted_desc, :class_name => "Client", :order => "id DESC"
has_many :clients_of_firm, :foreign_key => "client_of", :class_name => "Client", :order => "id"
has_many :clients_like_ms, :conditions => "name = 'Microsoft'", :class_name => "Client", :order => "id"