diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-02 10:25:00 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-02 10:28:06 -0800 |
commit | af022918716e894608d655cdb52ec3164fee597a (patch) | |
tree | 225100571841387ba06e8ec0caa9ff908dab7864 /activerecord/lib/active_record | |
parent | 867482335067bcef7faae91a7eaa9e98bf94ac62 (diff) | |
download | rails-af022918716e894608d655cdb52ec3164fee597a.tar.gz rails-af022918716e894608d655cdb52ec3164fee597a.tar.bz2 rails-af022918716e894608d655cdb52ec3164fee597a.zip |
only log an error if there is a logger. fixes #5226
Conflicts:
activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index 7d024a5549..63071909ad 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -54,7 +54,7 @@ module ActiveRecord define_callbacks :checkout, :checkin attr_accessor :visitor, :pool - attr_reader :schema_cache, :last_use, :in_use + attr_reader :schema_cache, :last_use, :in_use, :logger alias :in_use? :in_use def initialize(connection, logger = nil, pool = nil) #:nodoc: diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index ad0d0d7170..55bffc6518 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -204,7 +204,7 @@ module ActiveRecord value = super if column.type == :string && value.encoding == Encoding::ASCII_8BIT - @logger.error "Binary data inserted for `string` type on column `#{column.name}`" + logger.error "Binary data inserted for `string` type on column `#{column.name}`" if logger value.encode! 'utf-8' end value |