diff options
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index b838b1cdc0..e1f3dce7ce 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -895,9 +895,16 @@ module ActiveRecord #:nodoc: end end - # Returns a string looking like: #<Post id:integer, title:string, body:text> + # Returns a string like 'Post id:integer, title:string, body:text' def inspect - "#<#{name} #{columns.collect { |c| "#{c.name}: #{c.type}" }.join(", ")}>" + if self == Base + super + elsif abstract_class? + "#{super}(abstract)" + else + attr_list = columns.map { |c| "#{c.name}: #{c.type}" } * ', ' + "#{super}(#{attr_list})" + end end |