views:

29

answers:

1

Being that it is better to call a SQL database with the specific item, for example:

Bad:

SELECT * FROM tblUsers

Good:

SELECT email FROM tblUsers

How would I do this in RoR to make it explicitly perform the latter example?

+7  A: 

Assuming your tblUsers table is used by User model, you should do

User.all(:select => "email")
neutrino