diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/helper.rb | 2 | ||||
-rw-r--r-- | activerecord/test/support/mysql.rb | 11 |
3 files changed, 13 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index 6bf7af081f..bb63fddf9b 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -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 diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb index 4c6d4666ed..f39111ba77 100644 --- a/activerecord/test/cases/helper.rb +++ b/activerecord/test/cases/helper.rb @@ -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') diff --git a/activerecord/test/support/mysql.rb b/activerecord/test/support/mysql.rb new file mode 100644 index 0000000000..7a66415e64 --- /dev/null +++ b/activerecord/test/support/mysql.rb @@ -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 |