I have a rails application that connects to an old database.
when I request db, it returns things like "userID" instead of "id" and "userName" instead of "name".
I thought it would be easy enough to write in my controllers
: select => 'userID AS id, userName AS name'
but when I do this, the fields I'm trying to rename are not returned. Other fields that I do not smooth out are returned.
Is there a better way to do this? Maybe overlaying field names in the model?
source
share