From 8d78a82d797bf8809acb1d2ebb30cf81488ac99c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Tue, 12 Jan 2010 22:07:30 +0100 Subject: Deprecate ActiveRecord::Base.colorize_logging. --- activerecord/lib/active_record/base.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 0ecef4abb4..cc592aa2d3 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -516,14 +516,6 @@ module ActiveRecord #:nodoc: cattr_accessor :pluralize_table_names, :instance_writer => false @@pluralize_table_names = true - ## - # :singleton-method: - # Determines whether to use ANSI codes to colorize the logging statements committed by the connection adapter. These colors - # make it much easier to overview things during debugging (when used through a reader like +tail+ and on a black background), but - # may complicate matters if you use software like syslog. This is true, by default. - cattr_accessor :colorize_logging, :instance_writer => false - @@colorize_logging = true - ## # :singleton-method: # Determines whether to use Time.local (using :local) or Time.utc (using :utc) when pulling dates and times from the database. @@ -557,6 +549,13 @@ module ActiveRecord #:nodoc: self.default_scoping = [] class << self # Class methods + def colorize_logging(*args) + ActiveSupport::Deprecation.warn "ActiveRecord::Base.colorize_logging and " << + "config.active_record.colorize_logging are deprecated. Please use " << + "Rails::Subscriber.colorize_logging or config.colorize_logging instead", caller + end + alias :colorize_logging= :colorize_logging + # Find operates with four different retrieval approaches: # # * Find by id - This can either be a specific id (1), a list of ids (1, 5, 6), or an array of ids ([5, 6, 10]). -- cgit v1.2.3