aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-12 22:07:30 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-13 01:19:23 +0100
commit8d78a82d797bf8809acb1d2ebb30cf81488ac99c (patch)
tree1114a87194580dff6787d657dcc36280033ea33c
parent743cafb7f4a54d162a432c43974a5e5be55fd0b8 (diff)
downloadrails-8d78a82d797bf8809acb1d2ebb30cf81488ac99c.tar.gz
rails-8d78a82d797bf8809acb1d2ebb30cf81488ac99c.tar.bz2
rails-8d78a82d797bf8809acb1d2ebb30cf81488ac99c.zip
Deprecate ActiveRecord::Base.colorize_logging.
-rwxr-xr-xactiverecord/lib/active_record/base.rb15
-rwxr-xr-xactiverecord/test/cases/base_test.rb2
2 files changed, 8 insertions, 9 deletions
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
@@ -518,14 +518,6 @@ module ActiveRecord #:nodoc:
##
# :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.
# This is set to :local by default.
cattr_accessor :default_timezone, :instance_writer => false
@@ -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]).
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb
index 47e7a4bb79..aea6aed8d9 100755
--- a/activerecord/test/cases/base_test.rb
+++ b/activerecord/test/cases/base_test.rb
@@ -992,7 +992,7 @@ class BasicsTest < ActiveRecord::TestCase
end
def test_mass_assignment_protection_against_class_attribute_writers
- [:logger, :configurations, :primary_key_prefix_type, :table_name_prefix, :table_name_suffix, :pluralize_table_names, :colorize_logging,
+ [:logger, :configurations, :primary_key_prefix_type, :table_name_prefix, :table_name_suffix, :pluralize_table_names,
:default_timezone, :schema_format, :lock_optimistically, :record_timestamps].each do |method|
assert Task.respond_to?(method)
assert Task.respond_to?("#{method}=")