aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-12-06 00:01:11 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-12-06 00:01:11 +0000
commite16ecaf84c05b054a8ec3b776b3223880edda3d4 (patch)
tree025cc8e8b4097d15d30a700b92d45e913ac6af14 /activerecord/lib/active_record/base.rb
parent8f24701ae17a6bba0a9e648e38df2d17fb884792 (diff)
downloadrails-e16ecaf84c05b054a8ec3b776b3223880edda3d4.tar.gz
rails-e16ecaf84c05b054a8ec3b776b3223880edda3d4.tar.bz2
rails-e16ecaf84c05b054a8ec3b776b3223880edda3d4.zip
Fixed that the truncation of strings longer than 50 chars should use inspect so newlines etc are escaped (closes #10385) [norbert]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8319 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-xactiverecord/lib/active_record/base.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 506ea5621e..b80ade254b 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -2079,7 +2079,7 @@ module ActiveRecord #:nodoc:
value = read_attribute(attr_name)
if value.is_a?(String) && value.length > 50
- %("#{value[0..50]}...")
+ "#{value[0..50]}...".inspect
elsif value.is_a?(Date) || value.is_a?(Time)
%("#{value.to_s(:db)}")
else