diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-10 08:51:25 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-09-10 08:51:25 -0700 |
commit | 7b2363f06e0c87f25bf04705a4457b5d16d53423 (patch) | |
tree | 21c94781a91eaa1fa40bb37de94ee6852a0f74e5 /activerecord/test | |
parent | be8685d9227faf5d3691346e2cc0c4f14d833c53 (diff) | |
parent | 48498da0dfed5239ea1eafb243ce47d7e3ce9e8e (diff) | |
download | rails-7b2363f06e0c87f25bf04705a4457b5d16d53423.tar.gz rails-7b2363f06e0c87f25bf04705a4457b5d16d53423.tar.bz2 rails-7b2363f06e0c87f25bf04705a4457b5d16d53423.zip |
Merge pull request #7432 from kennyj/fix_annoy_warning
Suppress annoy warning, when executing AR's testcases.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/helper.rb | 2 | ||||
-rw-r--r-- | activerecord/test/support/mysql.rb | 11 |
2 files changed, 13 insertions, 0 deletions
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 |