Skip to content
This repository
Browse code

stop AR's debug.log filling with warnings about not being able to loa…

…d fixture classes

[#1045 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit f636c6fda037fbef25e98c81d019a6c600a18f66 1 parent d51a39f
Frederick Cheung authored September 14, 2008 jeremy committed September 14, 2008

Showing 1 changed file with 14 additions and 0 deletions. Show diff stats Hide diff stats

  1. 14  activerecord/test/cases/helper.rb
14  activerecord/test/cases/helper.rb
@@ -46,3 +46,17 @@ def execute_with_query_record(sql, name = nil, &block)
46 46
 class << ActiveRecord::Base
47 47
   public :with_scope, :with_exclusive_scope
48 48
 end
  49
+
  50
+unless ENV['FIXTURE_DEBUG']
  51
+  module Test #:nodoc:
  52
+    module Unit #:nodoc:
  53
+      class << TestCase #:nodoc:
  54
+        def try_to_load_dependency_with_silence(*args)
  55
+          ActiveRecord::Base.logger.silence { try_to_load_dependency_without_silence(*args)}
  56
+        end
  57
+
  58
+        alias_method_chain :try_to_load_dependency, :silence
  59
+      end
  60
+    end
  61
+  end
  62
+end

0 notes on commit f636c6f

Please sign in to comment.
Something went wrong with that request. Please try again.