From 3b4f558a17a0189c8eb9974f9f0de603347fdd46 Mon Sep 17 00:00:00 2001 From: Frederick Cheung Date: Sun, 14 Sep 2008 20:40:09 +0100 Subject: [PATCH] stop AR's debug.log filling with warnings about not being able to load fixture classes --- activerecord/test/cases/helper.rb | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/activerecord/test/cases/helper.rb b/activerecord/test/cases/helper.rb index f30d585..114abae 100644 --- a/activerecord/test/cases/helper.rb +++ b/activerecord/test/cases/helper.rb @@ -46,3 +46,17 @@ end class << ActiveRecord::Base public :with_scope, :with_exclusive_scope end + +unless ENV['FIXTURE_DEBUG'] + module Test #:nodoc: + module Unit #:nodoc: + class << TestCase #:nodoc: + def try_to_load_dependency_with_silence(*args) + ActiveRecord::Base.logger.silence { try_to_load_dependency_without_silence(*args)} + end + + alias_method_chain :try_to_load_dependency, :silence + end + end + end +end \ No newline at end of file -- 1.6.0.1