diff options
author | Bryan Stearns <bryanstearns@gmail.com> | 2009-09-30 23:17:50 -0700 |
---|---|---|
committer | Eloy Duran <eloy.de.enige@gmail.com> | 2010-01-08 21:45:02 +0100 |
commit | 1080351437dc43c3ecaa0d494f5ca215f03b1883 (patch) | |
tree | 371ebdf25e1ab947ae9ece41b959b9b6dc0f5a2b /activerecord/test/models | |
parent | 802b08da0075bf6426c723957447ed85dc849bba (diff) | |
download | rails-1080351437dc43c3ecaa0d494f5ca215f03b1883.tar.gz rails-1080351437dc43c3ecaa0d494f5ca215f03b1883.tar.bz2 rails-1080351437dc43c3ecaa0d494f5ca215f03b1883.zip |
Add failing test that triggers the stack overflow
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/invoice.rb | 4 | ||||
-rw-r--r-- | activerecord/test/models/line_item.rb | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/models/invoice.rb b/activerecord/test/models/invoice.rb new file mode 100644 index 0000000000..fc6ef0230e --- /dev/null +++ b/activerecord/test/models/invoice.rb @@ -0,0 +1,4 @@ +class Invoice < ActiveRecord::Base + has_many :line_items, :autosave => true + before_save {|record| record.balance = record.line_items.map(&:amount).sum } +end diff --git a/activerecord/test/models/line_item.rb b/activerecord/test/models/line_item.rb new file mode 100644 index 0000000000..0dd921a300 --- /dev/null +++ b/activerecord/test/models/line_item.rb @@ -0,0 +1,3 @@ +class LineItem < ActiveRecord::Base + belongs_to :invoice, :touch => true +end |