Rails codebase sharing


Currently any deployed app is automatically fed with database
from config/database.yml. This mean that if I set up applications
via FCGI I need to have a separate application deployment for each user.

Is it possible to share the same codebase and use different databases
(maybe some other stuff too) for separate users?

Currently I link application’s public directory to some directory in
users WWW directory.