1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/cases/adapters
Vitor Baptista e1e5f30057 Don't rely on Hash key's ordering
If we set encoding latin1 for a PostgreSQL database, it calls
PostgreSQLAdapter::create_database with options that have,
among other things:

  { 'encoding' => 'latin1' }

Then, we use reverse_merge(:encoding => "utf8") to setup the default
encoding. In the end, the hash looks like:

  { :encoding => 'utf8', 'encoding' => 'latin1' }

The call to options.symbolize_keys calls to_sym on each_key of this
Hash. It usually means that the encoding passed overwrites the default
utf8, but it's not guaranteed. So, we shouldn't rely on it.

The same was happening in ActiveRecord::ConnectionHandling.
2013-01-16 10:43:30 -03:00
..
firebird
mysql Remove unnecessary begin..rescue..end, use only rescue 2013-01-06 15:41:14 +09:00
mysql2 Remove unnecessary begin..rescue..end, use only rescue 2013-01-06 15:41:14 +09:00
oracle
postgresql Don't rely on Hash key's ordering 2013-01-16 10:43:30 -03:00
sqlite3 Remove not assigned variable warning from sqlite3 adapter test 2012-10-29 23:51:25 -02:00