aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-05-19 01:35:19 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-05-19 01:35:19 +0000
commita995b9cde074bec46ab4befc53f16ff91ec952f2 (patch)
treea42ff09357c6d3cb7b31661ffcd03e3211786d10 /activerecord/lib/active_record/base.rb
parent81ee044fdaf7b0ea15b4c646fa46947f71da00fe (diff)
downloadrails-a995b9cde074bec46ab4befc53f16ff91ec952f2.tar.gz
rails-a995b9cde074bec46ab4befc53f16ff91ec952f2.tar.bz2
rails-a995b9cde074bec46ab4befc53f16ff91ec952f2.zip
Fix #inspect for new records. Closes #8405.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6782 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 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