From c2c10eeca268151a6db5fe656520365a6d6a6f13 Mon Sep 17 00:00:00 2001 From: Evgeniy Dolzhenko Date: Fri, 3 Sep 2010 04:40:07 -0700 Subject: [PATCH] Make autoloadable by Rails 3 --- lib/{silent_postgres.rb => silent-postgres.rb} | 6 ++++++ 1 file changed, 6 insertions(+) rename lib/{silent_postgres.rb => silent-postgres.rb} (68%) diff --git a/lib/silent_postgres.rb b/lib/silent-postgres.rb similarity index 68% rename from lib/silent_postgres.rb rename to lib/silent-postgres.rb index f7113af..18b7722 100644 --- a/lib/silent_postgres.rb +++ b/lib/silent-postgres.rb @@ -17,3 +17,9 @@ module SilentPostgres METHOD end end + +if %w(test development).include?(ENV["RAILS_ENV"]) + puts "Silencing Postgres" + require 'silent_postgres' + ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.send(:include, SilentPostgres) +end