1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Avoid creating an extra Range instance

This commit is contained in:
Akira Matsuda 2013-07-10 16:23:04 +09:00
parent 54d893f9d8
commit 956671831d

View file

@ -281,7 +281,7 @@ module ActiveRecord
value = read_attribute(attr_name) value = read_attribute(attr_name)
if value.is_a?(String) && value.length > 50 if value.is_a?(String) && value.length > 50
"#{value[0..49]}...".inspect "#{value[0, 50]}...".inspect
elsif value.is_a?(Date) || value.is_a?(Time) elsif value.is_a?(Date) || value.is_a?(Time)
%("#{value.to_s(:db)}") %("#{value.to_s(:db)}")
else else