Guest User

Untitled

a guest
Jun 23rd, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. class CQM < ActiveRecord::Base
  2. self.abstract_class = true
  3.  
  4. establish_connection(
  5. :adapter => "mysql2",
  6. :host => "localhost",
  7. :username => "root",
  8. :password => "root",
  9. :database => "cqm_development"
  10. )
  11. end
  12.  
  13. class Abend < CQM
  14. end
  15.  
  16. class BlueIdeas < ActiveRecord::Base
  17. self.abstract_class = true
  18.  
  19. establish_connection(
  20. :adapter => "mysql2",
  21. :host => "localhost",
  22. :username => "root",
  23. :password => "root",
  24. :database => "blue-ideas_development"
  25. )
  26. end
  27.  
  28. class Comment < BlueIdeas
  29. end
  30.  
  31. Comment.transaction do
  32. Comment.create :user_id => 1, :idea_id => 1, :body => "ROLLBACKS!"
  33.  
  34. Abend.transaction do
  35. Abend.create :job_id => 1, :return_code => 1, :abended_on => Time.now
  36. end
  37.  
  38. raise "oh noes!"
  39. end
Add Comment
Please, Sign In to add comment