Changeset 8319
- Timestamp:
- 12/06/07 00:01:11 (9 months ago)
- Files:
-
- trunk/activerecord/CHANGELOG (modified) (1 diff)
- trunk/activerecord/lib/active_record/base.rb (modified) (1 diff)
- trunk/activerecord/test/base_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/CHANGELOG
r8313 r8319 1 1 *SVN* 2 3 * Fixed that the truncation of strings longer than 50 chars should use inspect so newlines etc are escaped #10385 [norbert] 2 4 3 5 * Fixed that habtm associations should be able to set :select as part of their definition and have that honored [DHH] trunk/activerecord/lib/active_record/base.rb
r8298 r8319 2080 2080 2081 2081 if value.is_a?(String) && value.length > 50 2082 %("#{value[0..50]}...")2082 "#{value[0..50]}...".inspect 2083 2083 elsif value.is_a?(Date) || value.is_a?(Time) 2084 2084 %("#{value.to_s(:db)}") trunk/activerecord/test/base_test.rb
r8259 r8319 1733 1733 def test_attribute_for_inspect 1734 1734 t = topics(:first) 1735 t. content = %(This is some really long content, longer than 50 characters, so I can test that text is truncated correctly by the new ActiveRecord::Base#inspect method! Yay! BOOM!)1735 t.title = "The First Topic Now Has A Title With\nNewlines And More Than 50 Characters" 1736 1736 1737 1737 assert_equal %("#{t.written_on.to_s(:db)}"), t.attribute_for_inspect(:written_on) 1738 assert_equal '"Th is is some really long content, longer than 50 ch..."', t.attribute_for_inspect(:content)1738 assert_equal '"The First Topic Now Has A Title With\nNewlines And M..."', t.attribute_for_inspect(:title) 1739 1739 end 1740 1740