Re: how to switch a view easily?
[prev]
[thread]
[next]
[Date index for 2005/04/20]
On Wed, 2005-04-20 at 08:07 -0400, Dana Hudes wrote:
> How about moving deleted bookings to a separate deleted_bookings table?
> you will make an extra query against the database if they want to see
> deleted bookings.
That can get pretty messy with all the joins.
> On Wed, 19 Apr 2005, Randal L. Schwartz wrote:
> > My $client has an app with "Booking" being a centrally important
> > joining table (lots of has-many's on both sides). One of the fields
> > of Booking indicates whether the Booking has been deleted. Now
> > $client wants entire app to have two modes... "include deleted
> > bookings" and "exclude deleted bookings".
> >
> > Other than changing all my nice nifty working code to include huge
> > amounts of new ->search_where's everywhere... is there some easy
> > method I can use instead?
> >
> > Certainly I can't be the first one to need this. :)
What database is this running on? Specifically does it have views?
If so could you create views for the 2 sets and then use a quick
sub-class that just changes the table (view) it uses. Then all your
nifty code is shared by both and the mode can be set by the class you
use.
mark
--
This email (and any attachments) is intended solely for the individual(s) to whom addressed.
It may contain confidential and/or legally privileged information.
Any statement or opinions therein are not necessarily those of ITN unless specifically stated.
Any unauthorised use, disclosure or copying is prohibited.
If you have received this email in error, please notify the sender and delete it from your system.
Security and reliability of the e-mail and attachments are not guaranteed.
You must take full responsibility for virus checking.
Independent Television News Limited,
Registered No. 548648 England,
VAT Reg. No: GB 756 2995 81,
200 Gray's Inn Road, London WC1X 8XZ,
Telephone: 020 7833 3000.
|
(message missing)
|