Permalink
Browse files

Fix annoy warning, when executing testcase.

  • Loading branch information...
1 parent be8685d commit a3024f81228d7b3b446408114a5dc2a86870cd35 @kennyj kennyj committed Sep 10, 2012
Showing with 13 additions and 0 deletions.
  1. +2 −0 activerecord/test/cases/helper.rb
  2. +11 −0 activerecord/test/support/mysql.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')
@@ -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.