Hi,

I recently found a way to do with Active Record queries something I'd
previously done in other languages a lot, which was aggregations and
simple calculations or IF() statements in the SELECT clause aliased to
a column name. It turns out Active Record allows this and adds
temporary attributes to the models that come back from the query. An
example use might be to do multiple counts with a single query.

My question is simply: Is this a good practice? Why or why not?

There's more details on the Stack Overflow question
(http://stackoverflow.com/questions/11354469/pros-cons-of-using-activerecord-select-to-create-temporary-attributes).

Thanks,

James

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" 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/rails-oceania?hl=en.

Reply via email to