diff options
author | Dylan Thacker-Smith <Dylan.Smith@shopify.com> | 2013-09-04 18:36:28 -0400 |
---|---|---|
committer | Dylan Thacker-Smith <Dylan.Smith@shopify.com> | 2013-09-11 14:27:27 -0400 |
commit | a94e2db05ccd0d4ae7681d26b4ce929184cffefc (patch) | |
tree | 00fdab1fb3af278c29bde03048752a7e8637c988 /activerecord/test | |
parent | 233c6d4c298434544e349a559906f5fa1883e070 (diff) | |
download | rails-a94e2db05ccd0d4ae7681d26b4ce929184cffefc.tar.gz rails-a94e2db05ccd0d4ae7681d26b4ce929184cffefc.tar.bz2 rails-a94e2db05ccd0d4ae7681d26b4ce929184cffefc.zip |
Avoid empty transaction from setting has_one association on new record.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/has_one_associations_test.rb | 2 |
1 files changed, 2 insertions, 0 deletions
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 |