aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/has_many_associations_test.rb
diff options
context:
space:
mode:
authorFarley Knight <farleyknight@gmail.com>2011-05-31 06:08:11 -0400
committerJon Leighton <j@jonathanleighton.com>2011-05-31 19:47:34 +0100
commitaa316e27b7f6f17328f2be6c481f7d9ee3a92f86 (patch)
tree59d32518618ad4b87d976f52cdf9c39753f2e1cc /activerecord/test/cases/associations/has_many_associations_test.rb
parent60cb96abead70eb9d510efd56013ec705baf0d63 (diff)
downloadrails-aa316e27b7f6f17328f2be6c481f7d9ee3a92f86.tar.gz
rails-aa316e27b7f6f17328f2be6c481f7d9ee3a92f86.tar.bz2
rails-aa316e27b7f6f17328f2be6c481f7d9ee3a92f86.zip
Tests for issue #1360
Diffstat (limited to 'activerecord/test/cases/associations/has_many_associations_test.rb')
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb9
1 files changed, 9 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 43974fd895..a493ea9974 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -2,6 +2,7 @@ require "cases/helper"
require 'models/developer'
require 'models/project'
require 'models/company'
+require 'models/contract'
require 'models/topic'
require 'models/reply'
require 'models/category'
@@ -1475,4 +1476,12 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
tagging = Tagging.create! :taggable => post
assert_equal [tagging], post.taggings
end
+
+ def test_dont_call_save_callbacks_twice_on_has_many
+ firm = companies(:first_firm)
+ contract = firm.contracts.create!
+
+ assert_equal 1, contract.hi_count
+ assert_equal 1, contract.bye_count
+ end
end