I'm not sure I understand the question.
Are you talking about authenticating a users connection to the
database inside your application?
If so that has nothing todo with the rails database connection. You
need to lookinto a plugin that will do authentication and
authorization on the rails application side...
You want to lock down the access that you application has to the
GRANT SELECT,DROP ON app_production.* TO 'someuser'@'somewhere'
IDENTIFIED BY 'somepassword';
That gives someuser connecting from host somwhere SELECT and DROP
access to the app_production database with the password
Does that answer your question or am I way off?