提交 7b2363f0 编写于 作者: R Rafael Mendonça França

Merge pull request #7432 from kennyj/fix_annoy_warning

Suppress  annoy warning, when executing AR's testcases.
......@@ -7,8 +7,6 @@
class Mysql
class Time
###
# This monkey patch is for test_additional_columns_from_join_table
def to_date
Date.new(year, month, day)
end
......
......@@ -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')
......
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册