aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorBogdan Gusiev <agresso@gmail.com>2015-11-23 16:22:03 +0200
committerBogdan Gusiev <agresso@gmail.com>2015-11-23 16:22:03 +0200
commit6d0d83a33f59d9415685852cf77818c41e2e2700 (patch)
treecd201839897deccfc6c8ee310c292c6ec4210dcb /activerecord/test/models
parent4547e894e9f924221f1ec4ff8e71fa750bab3595 (diff)
downloadrails-6d0d83a33f59d9415685852cf77818c41e2e2700.tar.gz
rails-6d0d83a33f59d9415685852cf77818c41e2e2700.tar.bz2
rails-6d0d83a33f59d9415685852cf77818c41e2e2700.zip
Bugfix collection association #create method …
When same association is loaded in the model creation callback The new object is inserted into association twice
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/bulb.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/models/bulb.rb b/activerecord/test/models/bulb.rb
index c1e491e5c5..dc0296305a 100644
--- a/activerecord/test/models/bulb.rb
+++ b/activerecord/test/models/bulb.rb
@@ -50,3 +50,9 @@ class FailedBulb < Bulb
throw(:abort)
end
end
+
+class TrickyBulb < Bulb
+ after_create do |record|
+ record.car.bulbs.to_a
+ end
+end