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

**URL:** <https://www.ruby-forum.com/t/marking-flagging-a-record-as-deleted-expired-instead-of-actu/103224>\
**Category:** Rails\
**Created:** [May 3, 2007, 3:51am UTC](https://www.ruby-forum.com/t/marking-flagging-a-record-as-deleted-expired-instead-of-actu/103224 "2007-05-03T03:51:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![james](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@james](https://www.ruby-forum.com/u/james)\
**Post date:** [May 3, 2007, 3:51am UTC](https://www.ruby-forum.com/t/marking-flagging-a-record-as-deleted-expired-instead-of-actu/103224/1 "2007-05-03T03:51:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![james](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@james](https://www.ruby-forum.com/u/james)\
**Post date:** [May 3, 2007, 4:00am UTC](https://www.ruby-forum.com/t/marking-flagging-a-record-as-deleted-expired-instead-of-actu/103224/2 "2007-05-03T04:00:42Z")

</div>

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](http://agilewebdevelopment.com/plugins/acts_as_paranoid)

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

---

<div class="post-metadata">

**Author:** ![james](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@james](https://www.ruby-forum.com/u/james)\
**Post date:** [May 3, 2007, 7:00am UTC](https://www.ruby-forum.com/t/marking-flagging-a-record-as-deleted-expired-instead-of-actu/103224/3 "2007-05-03T07:00:53Z")

</div>

Thanks to both Jodi & Gregory for that

Cheers,  
James

---

<div class="post-metadata">

**Author:** ![james](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc8723/32.png) [@james](https://www.ruby-forum.com/u/james)\
**Post date:** [May 3, 2007, 4:02am UTC](https://www.ruby-forum.com/t/marking-flagging-a-record-as-deleted-expired-instead-of-actu/103224/4 "2007-05-03T04:02:42Z")

</div>

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/](http://ar-paranoid.rubyforge.org/)

> Thanks,  
> James.  
> –Greg
