Skip to content

Instantly share code, notes, and snippets.

@hypomodern
Created March 16, 2010 13:34
Show Gist options
  • Save hypomodern/333960 to your computer and use it in GitHub Desktop.
Save hypomodern/333960 to your computer and use it in GitHub Desktop.
>> c = Client.new(:name => "Rollmeback", :timezone => "UTC")
=> #<Client id: nil, name: "Rollmeback", ...>
>> Client.transaction do
?> c.save
>> raise ActiveRecord::Rollback
>> end
=> nil
>> c.id
=> 26
>> Client.find(26)
ActiveRecord::RecordNotFound: Couldn't find Client with ID=26
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:1586:in `find_one'
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:1569:in `find_from_ids'
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:616:in `find'
from (irb):18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment