diff options
author | Paul Nikitochkin <paul.nikitochkin@gmail.com> | 2013-12-22 18:18:40 +0200 |
---|---|---|
committer | Paul Nikitochkin <paul.nikitochkin@gmail.com> | 2013-12-23 15:44:48 +0200 |
commit | 2bcf7158d346e1b619aebbbec360ee0153ef8d06 (patch) | |
tree | c6ada73df4d56a65a9d4ddd5d94c9ae7a53d6333 /activerecord/test | |
parent | 00fc64a6dce4930e5f762c1c1d742addc0cf9e42 (diff) | |
download | rails-2bcf7158d346e1b619aebbbec360ee0153ef8d06.tar.gz rails-2bcf7158d346e1b619aebbbec360ee0153ef8d06.tar.bz2 rails-2bcf7158d346e1b619aebbbec360ee0153ef8d06.zip |
On destroying do not touch destroyed belongs to association.
Fixes: #13445
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/belongs_to_associations_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb index 6d01fcf50c..3205d0c28b 100644 --- a/activerecord/test/cases/associations/belongs_to_associations_test.rb +++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb @@ -356,6 +356,14 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase assert_queries(2) { line_item.destroy } end + def test_belongs_to_with_touch_option_on_destroy_with_destroyed_parent + line_item = LineItem.create! + invoice = Invoice.create!(line_items: [line_item]) + invoice.destroy + + assert_queries(1) { line_item.destroy } + end + def test_belongs_to_with_touch_option_on_touch_and_reassigned_parent line_item = LineItem.create! Invoice.create!(line_items: [line_item]) |