in the rdoc for the ActiveRecord Base class they indicate how to
retrieve records dynamically using find_by_XYZ, however, what if you
don’t want the whole record back? Do all the find methods return arrays
of the object or is it possible for a find method to say return an array
of one of the columns in the object.
I’ve an Alert class and a corresponding Alert table in the DB. There’s a
message column, ‘message’ and a creation time column ‘creation’.
I was hoping to retrieve all the messages that occured in the last 30
mins but the following code seems invalid…
messages = 
messages = Alert.find_message(:all, :condition =>“creation > sysdate -
interval ‘30’ minute”)
I don’t want to go retrieving the entire Alert object from the DB solely
for one column as in cases where there are hundreds of messages, object
creation would be a big factor I think.
If it’s poss could anyone give me some idea as to how to go about it.