Tom,

You may try the inspect() way:

inspect()

Returns a string like ‘Post id:integer, title:string, body:text‘

# File vendor/rails/activerecord/lib/active_record/base.rb, line 1348
1348:       def inspect
1349:         if self == Base
1350:           super
1351:         elsif abstract_class?
1352:           "#{super}(abstract)"
1353:         elsif table_exists?
1354:           attr_list = columns.map { |c| "#{c.name}: #{c.type}" }
* ', '
1355:           "#{super}(#{attr_list})"
1356:         else
1357:           "#{super}(Table doesn't exist)"
1358:         end
1359:       end

Cheers, Sazima

On Dec 17, 7:30 am, Tom Ha <[email protected]> wrote:
> Thanks a bunch, guys!
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to