[LRUG] Deleting data that's in use

Andrew Stewart boss at airbladesoftware.com
Wed Nov 12 10:16:52 PST 2008


Hi El Rug,

(This isn't a Ruby language question; it's more of an interaction  
design question.)

In my current app users manage the loaning of stuff to companies.   
It's a bit like a library loaning books to customers.  Every loan  
generates a delivery note which records what was lent to whom.

Today a user wanted to delete one of the companies from the system.   
This company has received a number of loans in the past.  The deletion  
(correctly) failed because a foreign key constraint in the database  
said no, you can't delete that company because it's referenced by  
several delivery notes.  So the company is still there, causing much  
rolling of eyes and shrugging of shoulders by the user.

What's the best way to handle this?

I'm thinking that deleting the company would indeed be wrong because  
it breaks the delivery notes in question.  Perhaps when the user  
clicks delete, the system should "soft delete" it (if there are any  
delivery notes referring to it, otherwise delete as normal) -- i.e.  
freeze the company's attributes, don't show it in any list of  
companies, and don't delete it.

Is this a good idea?  Are there better ideas?  I'd value your thoughts.

Thanks and regards,

Andy Stewart

-------
http://airbladesoftware.com






More information about the Chat mailing list