Additional database condition in -all- queries?

Jake Janovetz
2005-12-01T20:29:20Z

Hello-

Regarding a web application that is provided to several different
customers, my original plan was to have separate databases for each
customer.  The Rails app would then choose the right database determined
by the customer''s login.

Others suggested rolling everyone''s data into the same database.  My
question regarding this method is how to segregate the data.  I could
add a condition like "WHERE customer_id = ?", but it would nice to
somehow add this to -all- queries (DRY, right?).  Is this possible?

   Jake