Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix annoy warning, when executing testcase.

  • Loading branch information...
commit a3024f81228d7b3b446408114a5dc2a86870cd35 1 parent be8685d
@kennyj kennyj authored
View
2  activerecord/test/cases/helper.rb
@@ -22,6 +22,8 @@
# Connect to the database
ARTest.connect
+require 'support/mysql'
+
# Quote "type" if it's a reserved word for the current connection.
QUOTED_TYPE = ActiveRecord::Base.connection.quote_column_name('type')
View
11 activerecord/test/support/mysql.rb
@@ -0,0 +1,11 @@
+if defined?(Mysql)
+ class Mysql
+ class Error
+ # This monkey patch fixes annoy warning with mysql-2.8.1.gem when executing testcases.
+ def errno_with_fix_warnings
+ silence_warnings { errno_without_fix_warnings }
+ end
+ alias_method_chain :errno, :fix_warnings
+ end
+ end
+end

0 comments on commit a3024f8

Please sign in to comment.
Something went wrong with that request. Please try again.