1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #7432 from kennyj/fix_annoy_warning

Suppress  annoy warning, when executing AR's testcases.
This commit is contained in:
Rafael Mendonça França 2012-09-10 08:51:25 -07:00
commit 7b2363f06e
3 changed files with 13 additions and 2 deletions

View file

@ -7,8 +7,6 @@ require 'mysql'
class Mysql
class Time
###
# This monkey patch is for test_additional_columns_from_join_table
def to_date
Date.new(year, month, day)
end

View file

@ -22,6 +22,8 @@ ActiveSupport::Deprecation.debug = true
# 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 file

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