Skip to content

Commit

Permalink
Fix mysql config.
Browse files Browse the repository at this point in the history
  • Loading branch information
nashby committed Dec 24, 2021
1 parent 50b5b50 commit bf927d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/activerecord_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,18 @@
'schema_search_path' => 'public'
}
}

case db
when :postgresql
ActiveRecord::Base.establish_connection(:postgresql_master)
ActiveRecord::Base.connection.recreate_database('enumerize_test')
when :mysql2
ActiveRecord::Tasks::DatabaseTasks.create ActiveRecord::Base.configurations[db.to_s]
if ActiveRecord::Base.configurations.respond_to?(:[])
ActiveRecord::Tasks::DatabaseTasks.create ActiveRecord::Base.configurations[db.to_s]
else
ActiveRecord::Tasks::DatabaseTasks.create ActiveRecord::Base.configurations.find_db_config(db.to_s)
end

ActiveRecord::Base.establish_connection(db)
else
ActiveRecord::Base.establish_connection(db)
Expand Down

0 comments on commit bf927d3

Please sign in to comment.