aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/log_subscriber.rb
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2016-07-18 14:51:31 -0400
committerGitHub <noreply@github.com>2016-07-18 14:51:31 -0400
commit5a302bf553af0e6fedfc63299fc5cd6e79599ef3 (patch)
tree98f5ab78987d86a2cfe2eff424c80c291d2259b7 /activerecord/lib/active_record/log_subscriber.rb
parentaf1fd0fcae53fd63ac155a8aefc090c159a48209 (diff)
parent51598abaf17f1525207bc0df28a5ee61d2a0269e (diff)
downloadrails-5a302bf553af0e6fedfc63299fc5cd6e79599ef3.tar.gz
rails-5a302bf553af0e6fedfc63299fc5cd6e79599ef3.tar.bz2
rails-5a302bf553af0e6fedfc63299fc5cd6e79599ef3.zip
Merge pull request #25881 from kamipo/logging_type_casted_binds
Logging type casted binds
Diffstat (limited to 'activerecord/lib/active_record/log_subscriber.rb')
-rw-r--r--activerecord/lib/active_record/log_subscriber.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/log_subscriber.rb b/activerecord/lib/active_record/log_subscriber.rb
index 8e32af1c49..37a092d7a2 100644
--- a/activerecord/lib/active_record/log_subscriber.rb
+++ b/activerecord/lib/active_record/log_subscriber.rb
@@ -28,7 +28,7 @@ module ActiveRecord
"<#{attribute.value.bytesize} bytes of binary data>"
end
else
- attribute.value_for_database
+ type_cast(attribute.value_for_database)
end
[attribute.name, value]
@@ -91,6 +91,10 @@ module ActiveRecord
def logger
ActiveRecord::Base.logger
end
+
+ def type_cast(value)
+ ActiveRecord::Base.connection.type_cast(value)
+ end
end
end