From 22b767853d9375f2fe3d88e3833eb37e3796520d Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 25 May 2011 11:08:24 -0400 Subject: [PATCH] ensure silence method exists --- lib/silent-postgres.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/silent-postgres.rb b/lib/silent-postgres.rb index dccd51b..a529165 100755 --- a/lib/silent-postgres.rb +++ b/lib/silent-postgres.rb @@ -20,7 +20,11 @@ if Rails.env.development? || Rails.env.test? eval <<-METHOD def #{m1}_with_silencer#{m2}(*args) - @logger.silence do + if @logger.respond_to?(:silence) + @logger.silence do + #{m1}_without_silencer#{m2}(*args) + end + else #{m1}_without_silencer#{m2}(*args) end end