Created
September 27, 2010 13:36
-
-
Save reu/599035 to your computer and use it in GitHub Desktop.
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
class CQM < ActiveRecord::Base | |
self.abstract_class = true | |
establish_connection( | |
:adapter => "mysql2", | |
:host => "localhost", | |
:username => "root", | |
:password => "root", | |
:database => "cqm_development" | |
) | |
end | |
class Abend < CQM | |
end | |
class BlueIdeas < ActiveRecord::Base | |
self.abstract_class = true | |
establish_connection( | |
:adapter => "mysql2", | |
:host => "localhost", | |
:username => "root", | |
:password => "root", | |
:database => "blue-ideas_development" | |
) | |
end | |
class Comment < BlueIdeas | |
end | |
Comment.transaction do | |
Comment.create :user_id => 1, :idea_id => 1, :body => "ROLLBACKS!" | |
Abend.transaction do | |
Abend.create :job_id => 1, :return_code => 1, :abended_on => Time.now | |
end | |
raise "oh noes!" | |
end |
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
class Log < ActiveRecord::Base | |
end | |
class Comment < ActiveRecord::Base | |
end | |
Comment.establish_connection( | |
:adapter => "mysql2", | |
:host => "localhost", | |
:username => "root", | |
:password => "root", | |
:database => "blue-ideas_development" | |
) | |
Log.establish_connection( | |
:adapter => "mysql2", | |
:host => "localhost", | |
:username => "root", | |
:password => "root", | |
:database => "blue-ideas_development" | |
) | |
Comment.transaction do | |
Comment.create :user_id => 1, :idea_id => 1, :body => "ROLLBACKS!" | |
Log.transaction do | |
Log.create :description => "SHIT|" | |
end | |
raise "oh noes!" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment