Marking/Flagging a record as deleted/expired instead of actu

Hi,

I’ve a system which does not delete records from the database but
marks them as ‘expired’ and the excludes such in any view of the
current data.

Is there an easy way to override the behaviour of AR.destroy to have
it behave in this fashion or am I best off just introducing an
“expire” method instead?

Thanks,
James.

On 2-May-07, at 9:50 PM, James wrote:

Thanks,
James.

James,

Check out Rick’s fine acts_as_paranoid - it does what you’ve done but
overrides delete.

http://agilewebdevelopment.com/plugins/acts_as_paranoid

Cheers,
Jodi
General Partner
The nNovation Group inc.
www.nnovation.ca/blog

Thanks to both Jodi & Gregory for that

Cheers,
James

On Thu, May 03, 2007 at 01:50:44AM -0000, James wrote:

Hi,

I’ve a system which does not delete records from the database but
marks them as ‘expired’ and the excludes such in any view of the
current data.

Is there an easy way to override the behaviour of AR.destroy to have
it behave in this fashion or am I best off just introducing an
“expire” method instead?

acts_as_paranoid

http://ar-paranoid.rubyforge.org/

Thanks,
James.
–Greg

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs