Fix annoy warning, when executing testcase.

This commit is contained in:
kennyj 2012-09-11 00:15:29 +09:00
parent be8685d922
commit a3024f8122
2 changed files with 13 additions and 0 deletions

@ -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