Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix annoy warning, when executing testcase.

  • Loading branch information...
commit a3024f81228d7b3b446408114a5dc2a86870cd35 1 parent be8685d
Toshinori Kajihara kennyj authored
2  activerecord/test/cases/helper.rb
View
@@ -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')
11 activerecord/test/support/mysql.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.