aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-10-24 21:39:04 +0530
committerPratik Naik <pratiknaik@gmail.com>2008-10-24 21:39:04 +0530
commit6b41e0257a332de97777424e7c96cd9b8bb8db2b (patch)
treeeb3e71cc856adbc8f64188111a5437008c0f73c1 /activerecord/test
parent9ae15df21c3c3be4f46759b41a752f5b05333196 (diff)
parenta17fc20eb122d45a017e99e592e5e159025ab26b (diff)
downloadrails-6b41e0257a332de97777424e7c96cd9b8bb8db2b.tar.gz
rails-6b41e0257a332de97777424e7c96cd9b8bb8db2b.tar.bz2
rails-6b41e0257a332de97777424e7c96cd9b8bb8db2b.zip
Merge commit 'mainstream/master'
Conflicts: railties/doc/guides/html/2_2_release_notes.html railties/doc/guides/source/2_2_release_notes.txt
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb7
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]