diff options
author | Vladimir Meremyanin <vladimir@meremyanin.com> | 2009-08-09 23:09:08 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-08-09 23:10:23 +0100 |
commit | 08ec22054f56442b10f67e41c3b7593da6adcabd (patch) | |
tree | c765086fd728e2c8b2fd5c9b80f04d3c2b5f6fb9 /activerecord/test/cases/associations | |
parent | 916b18adeb0a1ae09fdaff21dda8d0bc8ed4ffa9 (diff) | |
download | rails-08ec22054f56442b10f67e41c3b7593da6adcabd.tar.gz rails-08ec22054f56442b10f67e41c3b7593da6adcabd.tar.bz2 rails-08ec22054f56442b10f67e41c3b7593da6adcabd.zip |
Make sure association conditions work with :include and :joins [#358 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 6 |
1 files changed, 6 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 9345b469ab..b16395776e 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -287,6 +287,12 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert_equal client2, firm.clients.find(:first, :conditions => ["#{QUOTED_TYPE} = :type", { :type => 'Client' }], :order => "id") end + def test_find_all_with_include_and_conditions + assert_nothing_raised do + Developer.find(:all, :joins => :audit_logs, :conditions => {'audit_logs.message' => nil, :name => 'Smith'}) + end + end + def test_find_in_collection assert_equal Client.find(2).name, companies(:first_firm).clients.find(2).name assert_raise(ActiveRecord::RecordNotFound) { companies(:first_firm).clients.find(6) } |