How can I determine which attributes are available in a Ruby model object?

By using the »attributes«, »attribute_names«, and »attribute_present?« methods.
The first returns a hash of attribute name/value pairs, the second an array of names, and the third returns true if a named attribute is available in this model object.


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.