Created
March 18, 2013 15:22
-
-
Save sycobuny/5187938 to your computer and use it in GitHub Desktop.
Trying to get transactions to misbehave similar to https://gist.github.com/rintaun/5186914
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sequel' | |
require 'logger' | |
DB = Sequel.postgres('steve', :host => 'localhost') | |
DB.loggers << Logger.new($stdout) | |
# DB.run 'CREATE TABLE cars (id SERIAL PRIMARY KEY, asdf TEXT NOT NULL) WITHOUT OIDS;' | |
class Car < Sequel::Model | |
end | |
DB.transaction do | |
Car.new do |car| | |
car.asdf = 'Saturn' | |
car.save | |
end | |
Car.new do |car| | |
car.save | |
end | |
puts "Sup guys" | |
end | |
# DB.run 'DROP TABLE cars;' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment