if %w{test development production}.include? ENV['RAILS_ENV'] ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.class_eval do def log_info_with_system_call_filtering(sql, name, runtime) if (sql.nil? || !sql.include?('FROM pg_attribute')) && (name != 'PK and serial sequence') log_info_without_system_call_filtering(sql, name, runtime) end end alias_method_chain :log_info, :system_call_filtering end end