diff options
author | heavysixer <heavysixer@gmail.com> | 2008-10-25 13:33:39 -0500 |
---|---|---|
committer | heavysixer <heavysixer@gmail.com> | 2008-10-25 13:33:39 -0500 |
commit | 14f05140e53f4f58bc86ee08b9a4ba836c14f9be (patch) | |
tree | 03b975c55bb42b964edc8a3507f63f92487a42ed /activerecord/test | |
parent | 35f29f7ea5ba183e49e26367cc31649ff4bd0e97 (diff) | |
parent | 650aa015789c704ca8ea864f1117faf3f404a59b (diff) | |
download | rails-14f05140e53f4f58bc86ee08b9a4ba836c14f9be.tar.gz rails-14f05140e53f4f58bc86ee08b9a4ba836c14f9be.tar.bz2 rails-14f05140e53f4f58bc86ee08b9a4ba836c14f9be.zip |
Merge branch 'master' of git@github.com:lifo/docrails
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 7 |
1 files changed, 7 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 8d97b30c74..59784e1bcb 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -853,6 +853,13 @@ class HasManyAssociationsTest < ActiveRecord::TestCase assert !company.clients.loaded? end + def test_get_ids_for_unloaded_finder_sql_associations_loads_them + company = companies(:first_firm) + assert !company.clients_using_sql.loaded? + assert_equal [companies(:second_client).id], company.clients_using_sql_ids + assert company.clients_using_sql.loaded? + end + def test_assign_ids firm = Firm.new("name" => "Apple") firm.client_ids = [companies(:first_client).id, companies(:second_client).id] |