Multiple apps - one database.yml?

R

Rick

Is is possible to have multiple apps whose root directories are in the
same directory that can share a single database.yml file?
 
J

Jonathan Yurek

Rick said:
Is is possible to have multiple apps whose root directories are in the
same directory that can share a single database.yml file?

Well, there's always the symlink or hard link. No sense putting into the
language/framework what's better kept in the filesystem.

-- Jon
 
M

Miles Keaton

Is is possible to have multiple apps whose root directories are in the
same directory that can share a single database.yml file?

Create separate directories for your separate Rails projects.

Then (assuming you're keeping your projects in Subversion) use
Subversions "externals" as described here:
http://svnbook.red-bean.com/en/1.1/ch07s04.html

cd /home/you/project2/
svn propset svn:externals "http://svn.yoursite.com/project1/trunk/models" m=
odels
svn propset svn:externals "http://svn.yoursite.com/project1/trunk/config" c=
onfig

Now project2 will use the config and models from project1.

We're doing this in a few different projects : 3 separate Rails
projects, all sharing the same models and database-config.

Any time you make changes to "project1", then next time you do an svn
update on project2 it will update.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top