Saiho Y. <sayoyo@…> writes:
How should I use Activerecord to map to a database
schemas with Psotgresql? Where can I find the
infomation about how to use schemas in Rails?
Can you give some more details on what you are trying to do?
Are you trying to have one RoR app’s set of model objects map to
schemas at the same time :
Blog object maps to schema X
Post object maps to schema Y
have different instances(dev, test, qa, integration) of an app map to
schemas in the same database?
integration app instance maps to schema INT
qa app instance maps to schema QA
One thing I’ve done is have a shared integration database, where each
log in with their own db username so they can test in a more complete
environment rather than their own local sandbox which might have alot of
mocked out. Then using postgres’ schema search path feature, each
login’s schema is the first in the search path, so when they launch
their app it
connects to their own schema instead of the public schema.