This project is archived and is in readonly mode.

#3214 ✓resolved
Sam Ruby

transactions don't fail in 3.0

Reported by Sam Ruby | September 15th, 2009 @ 09:53 PM | in 3.0.2

Section 20.4 of Agile Web Development with Rails describes how transactions can be used to prevent things such as negative balances from being stored in a database. Doing so fails (as expected) in Rails 2.3.4 (and all prior versions of Rails), but doesn't fail (as you would hope it would) with Rails 3.0

Full scenario: http://intertwingly.net/projects/AWDwR3/checkdepot.html#section-20

The script itself is standalone, and I'm attaching it here. To run from a checked out version of Rails, set RUBYLIB as appropriate (see comment in the script); otherwise it will attempt to use the gem version of Rails installed on your system.

Run the script, passing in a single argument of '2' to see the behavior, thus:

ruby transactions.rb 2

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Referenced by

Pages