File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1717 'mysql2' => {
1818 'adapter' => 'mysql2' ,
1919 'host' => '127.0.0.1' ,
20- 'username' => 'root ' ,
21- 'password' => ENV [ 'MYSQL_ROOT_PASSWORD' ] ,
20+ 'username' => 'sammy ' ,
21+ 'password' => 'password' ,
2222 'database' => 'enumerize_test' ,
2323 'encoding' => 'utf8mb4' ,
2424 'charset' => 'utf8mb4'
3838 'schema_search_path' => 'public'
3939 }
4040 }
41+
4142 case db
4243 when :postgresql
4344 ActiveRecord ::Base . establish_connection ( :postgresql_master )
4445 ActiveRecord ::Base . connection . recreate_database ( 'enumerize_test' )
4546 when :mysql2
46- ActiveRecord ::Tasks ::DatabaseTasks . create ActiveRecord ::Base . configurations [ db . to_s ]
47+ if ActiveRecord ::Base . configurations . respond_to? ( :[] )
48+ ActiveRecord ::Tasks ::DatabaseTasks . create ActiveRecord ::Base . configurations [ db . to_s ]
49+ else
50+ ActiveRecord ::Tasks ::DatabaseTasks . create ActiveRecord ::Base . configurations . find_db_config ( db . to_s )
51+ end
52+
4753 ActiveRecord ::Base . establish_connection ( db )
4854 else
4955 ActiveRecord ::Base . establish_connection ( db )
You can’t perform that action at this time.
0 commit comments