From a995b9cde074bec46ab4befc53f16ff91ec952f2 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 19 May 2007 01:35:19 +0000 Subject: Fix #inspect for new records. Closes #8405. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6782 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/base.rb') diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 94b3ac1057..bf5ee1854d 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1814,7 +1814,7 @@ module ActiveRecord #:nodoc: # Format attributes nicely for inspect. def attribute_for_inspect(attr_name) - raise "Attribute not present #{attr_name}" unless has_attribute?(attr_name) + raise "Attribute not present #{attr_name}" unless has_attribute?(attr_name) || new_record? value = read_attribute(attr_name) if value.is_a?(String) && value.length > 50 -- cgit v1.2.3