The above script works fine right now, however the call to
result.attributes.values returns them in a different order than
@table.column_names, so that the values end up in the wrong places. ie.
the name will be under the email column etc.
any thoughts on how I can make it spit out in the order it's in from the
database?
So if I have that correct, I don't understand how the send method operates on the result object. Is it just passing a method name? I guess I was just mistakenly thinking of it in terms of key value pairing:
result.send(a) AS result[a]
result.send(a) just calls the method with name a on the result object.
result[a] would also be acceptable, accessing the attribute directly,
but failing if you've written a custom accessor method for that
attribute.