Guest User

Untitled

a guest
Mar 1st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. print "Using JDBC MySQL\n"
  2. require_dependency 'fixtures/course'
  3. require 'logger'
  4. require 'active_record/connection_adapters/jdbc_adapter'
  5.  
  6.  
  7. RAILS_DEFAULT_LOGGER = Logger.new('debug.log')
  8. RAILS_DEFAULT_LOGGER.level = Logger::DEBUG
  9. ActiveRecord::Base.logger = RAILS_DEFAULT_LOGGER
  10.  
  11. ActiveRecord::Base.configurations = {
  12. 'arunit' => {
  13. :adapter => 'jdbc',
  14. :url => 'jdbc:mysql://localhost/activerecord_unittest',
  15. :driver => 'com.mysql.jdbc.Driver',
  16. :username => 'rails',
  17. :password => 'rails',
  18. :encoding => 'utf8',
  19. :host => 'localhost'
  20. },
  21. 'arunit2' => {
  22. :adapter => 'jdbc',
  23. :url => 'jdbc:mysql://localhost/activerecord_unittest2',
  24. :driver => 'com.mysql.jdbc.Driver',
  25. :username => 'rails',
  26. :password => 'rails',
  27. :host => 'localhost'
  28. }
  29. }
  30.  
  31. ActiveRecord::Base.establish_connection 'arunit'
  32. Course.establish_connection 'arunit2'
Add Comment
Please, Sign In to add comment