Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print "Using JDBC MySQL\n"
- require_dependency 'fixtures/course'
- require 'logger'
- require 'active_record/connection_adapters/jdbc_adapter'
- RAILS_DEFAULT_LOGGER = Logger.new('debug.log')
- RAILS_DEFAULT_LOGGER.level = Logger::DEBUG
- ActiveRecord::Base.logger = RAILS_DEFAULT_LOGGER
- ActiveRecord::Base.configurations = {
- 'arunit' => {
- :adapter => 'jdbc',
- :url => 'jdbc:mysql://localhost/activerecord_unittest',
- :driver => 'com.mysql.jdbc.Driver',
- :username => 'rails',
- :password => 'rails',
- :encoding => 'utf8',
- :host => 'localhost'
- },
- 'arunit2' => {
- :adapter => 'jdbc',
- :url => 'jdbc:mysql://localhost/activerecord_unittest2',
- :driver => 'com.mysql.jdbc.Driver',
- :username => 'rails',
- :password => 'rails',
- :host => 'localhost'
- }
- }
- ActiveRecord::Base.establish_connection 'arunit'
- Course.establish_connection 'arunit2'
Add Comment
Please, Sign In to add comment