aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-20 21:03:56 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-20 21:03:56 -0300
commit437f464b391d6b915b2604e668c10740fe638edd (patch)
tree2b1eded108534ee0ed4ee73f0a15b3adb163bdd3 /activerecord/test
parent26931eb32082b3468dc12df59c4041841f64c510 (diff)
parent713fc39d93601043e027d5cd9ebcfa08064f9417 (diff)
downloadrails-437f464b391d6b915b2604e668c10740fe638edd.tar.gz
rails-437f464b391d6b915b2604e668c10740fe638edd.tar.bz2
rails-437f464b391d6b915b2604e668c10740fe638edd.zip
Merge pull request #14979 from brocktimus/master
Making belongs_to: touch behaviour be consistent with save updating updated_at
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/belongs_to_associations_test.rb7
1 files changed, 7 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 3b484a0d64..dc7314b450 100644
--- a/activerecord/test/cases/associations/belongs_to_associations_test.rb
+++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb
@@ -369,6 +369,13 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase
assert_queries(2) { line_item.update amount: 10 }
end
+ def test_belongs_to_with_touch_option_on_empty_update
+ line_item = LineItem.create!
+ Invoice.create!(line_items: [line_item])
+
+ assert_queries(0) { line_item.save }
+ end
+
def test_belongs_to_with_touch_option_on_destroy
line_item = LineItem.create!
Invoice.create!(line_items: [line_item])