Skip to content

Commit a2fd16b

Browse files
authored
Merge pull request #3313 from codealchemy/update-mysql-encoding-check
Fix encoding detection error for MySQL applications using a connection proxy
2 parents 73ac02f + a316490 commit a2fd16b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/rails_admin/adapters/active_record.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def encoding
7575
when 'postgresql'
7676
::ActiveRecord::Base.connection.select_one("SELECT ''::text AS str;").values.first.encoding
7777
when 'mysql2'
78-
::ActiveRecord::Base.connection.instance_variable_get(:@connection).encoding
78+
::ActiveRecord::Base.connection.raw_connection.encoding
7979
when 'oracle_enhanced'
8080
::ActiveRecord::Base.connection.select_one("SELECT dummy FROM DUAL").values.first.encoding
8181
else

0 commit comments

Comments
 (0)