From a94e2db05ccd0d4ae7681d26b4ce929184cffefc Mon Sep 17 00:00:00 2001 From: Dylan Thacker-Smith Date: Wed, 4 Sep 2013 18:36:28 -0400 Subject: Avoid empty transaction from setting has_one association on new record. --- activerecord/test/cases/associations/has_one_associations_test.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/test/cases/associations/has_one_associations_test.rb') diff --git a/activerecord/test/cases/associations/has_one_associations_test.rb b/activerecord/test/cases/associations/has_one_associations_test.rb index 4fdf9a9643..9cd4db8dc9 100644 --- a/activerecord/test/cases/associations/has_one_associations_test.rb +++ b/activerecord/test/cases/associations/has_one_associations_test.rb @@ -505,6 +505,8 @@ class HasOneAssociationsTest < ActiveRecord::TestCase assert_no_queries { company.account = nil } account = Account.find(2) assert_queries { company.account = account } + + assert_no_queries { Firm.new.account = account } end def test_has_one_assignment_triggers_save_on_change -- cgit v1.2.3