diff options
author | Akira Matsuda <ronnie@dio.jp> | 2013-07-10 16:23:04 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2013-07-10 16:23:04 +0900 |
commit | 956671831d43fa81a9f72e7fedbee3c4ef6e0896 (patch) | |
tree | fd9338dca0588c2306ea3e7cb3f8f4a5f7055a03 | |
parent | 54d893f9d8d080596c8ce74f28ef181b60e2994f (diff) | |
download | rails-956671831d43fa81a9f72e7fedbee3c4ef6e0896.tar.gz rails-956671831d43fa81a9f72e7fedbee3c4ef6e0896.tar.bz2 rails-956671831d43fa81a9f72e7fedbee3c4ef6e0896.zip |
Avoid creating an extra Range instance
-rw-r--r-- | activerecord/lib/active_record/attribute_methods.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index b3f97522c2..0b96f88197 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -281,7 +281,7 @@ module ActiveRecord value = read_attribute(attr_name) 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) %("#{value.to_s(:db)}") else |