# Two problems with Acts\_as\_paranoid

**URL:** <https://www.ruby-forum.com/t/two-problems-with-acts-as-paranoid/81363>\
**Category:** Rails\
**Created:** [January 8, 2007, 2:17pm UTC](https://www.ruby-forum.com/t/two-problems-with-acts-as-paranoid/81363 "2007-01-08T14:17:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![schmitr3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ea666f/32.png) [@schmitr3](https://www.ruby-forum.com/u/schmitr3)\
**Post date:** [January 8, 2007, 2:17pm UTC](https://www.ruby-forum.com/t/two-problems-with-acts-as-paranoid/81363/1 "2007-01-08T14:17:35Z")

</div>

Hi,

I’ve run into two small problems with acts\_as\_paranoid and wondered if  
anyone else has experienced them as well (and if yes, if they have any  
solutions).

1. When using has\_many :through, AAP doesn’t seem to take into account  
the fact that your join model might also be paranoid. My solution to  
this at the moment is to add an explicit conditions clause to the  
has\_many :through statement, i.e. “join\_model.deleted\_at IS NULL” - is  
there a better way of getting the same result?

2. My tests sometimes fail in a random fashion. Looking at the  
test.log, nothing is different between test invocations, so the only  
conclusion I can come to is that it has something to do with the  
timestamp comparison sometimes working and sometimes not. I’m not sure  
that the clock is set to 100% second accuracy on the machine I’m  
working on. Has anyone else had a similar problem?

Any comments much appreciated,

TIA,  
Roland

---

<div class="post-metadata">

**Author:** ![schmitr3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ea666f/32.png) [@schmitr3](https://www.ruby-forum.com/u/schmitr3)\
**Post date:** [January 10, 2007, 6:03pm UTC](https://www.ruby-forum.com/t/two-problems-with-acts-as-paranoid/81363/2 "2007-01-10T18:03:51Z")

</div>

Can you give a little more detail on the scenario? What’s a sample  
find call that’s causing you problems?

Alex

---

<div class="post-metadata">

**Author:** ![schmitr3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ea666f/32.png) [@schmitr3](https://www.ruby-forum.com/u/schmitr3)\
**Post date:** [February 22, 2007, 6:27am UTC](https://www.ruby-forum.com/t/two-problems-with-acts-as-paranoid/81363/3 "2007-02-22T06:27:35Z")

</div>

I can verify that using has\_many :through and acts\_as\_paranoid on the  
join model deleting a join works but finding through the join ignores  
the delete\_at value. As Roland mentioned, this works:

indicators = user.indicators.find(:all, :conditions =\>  
‘personal\_indicators.deleted\_at IS NULL’)

Marcus
