diff options
author | Patrick Joyce <patrick.t.joyce@gmail.com> | 2009-06-21 22:07:23 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-06-21 22:07:23 +0100 |
commit | 4851ca9e13a4317342df02ae25b1929340523f7a (patch) | |
tree | 790e327cce1077624b23db92cf56579e10bef59e /activerecord/test/cases/associations/has_many_associations_test.rb | |
parent | eb30e4ca40370b416566f1bbaf0204bb379883e4 (diff) | |
download | rails-4851ca9e13a4317342df02ae25b1929340523f7a.tar.gz rails-4851ca9e13a4317342df02ae25b1929340523f7a.tar.bz2 rails-4851ca9e13a4317342df02ae25b1929340523f7a.zip |
Generate proper :counter_sql from :finder_sql when there is a newline character immediately following 'SELECT' [#2118 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/test/cases/associations/has_many_associations_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index d99424f9cd..15919e2289 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -163,6 +163,11 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert_equal 0, Firm.find(:first).no_clients_using_counter_sql.size end + def test_counting_using_finder_sql + assert_equal 2, Firm.find(4).clients_using_sql.count + assert_equal 2, Firm.find(4).clients_using_multiline_sql.count + end + def test_belongs_to_sanity c = Client.new assert_nil c.firm |