I'm following through an example provided by DHH in his book, "Agile Web
Development with Rails". This example deals with a database with an
"orders" table that has column names, "name", "email", "address" and
The Order class is created thusly:
class Order < ActiveRecord::Base
Later the example describes one way of reading data from the rows of the
table as follows:
pos = Order.find(:all, :conditions => "name = 'Dave' and pay_type =
Then, the author says, "The result will be an array of all matching
rows, each neatly wrapped in an Order object."
It would have been nice if he had gone on to at least describe some of
the characteristics of this particular object. He doesn't. I have a
feeling that one thing that's important for us to know about this object
is that the values for each field in the table row is contained in an
instance variable with the name of the column heading. I'm not sure if
the raw name of the column heading is massaged in any way, i.e.,
singular/plural, upper/lower case, etc. I'm also assuming that there
are accessor methods for these instance variables. What I'd like to
know is whether what I have surmised is, in fact, true. I'd also like
to know if there is anything else that I should know about this object.
Can someone please fill in the blanks for me?
TIA any input.