# Problems with acts\_as\_paranoid (noticed while using acts\_as\_

**URL:** <https://www.ruby-forum.com/t/problems-with-acts-as-paranoid-noticed-while-using-acts-as/83688>\
**Category:** Rails\
**Created:** [January 28, 2007, 9:45pm UTC](https://www.ruby-forum.com/t/problems-with-acts-as-paranoid-noticed-while-using-acts-as/83688 "2007-01-28T21:45:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![addywaddy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ea5d25/32.png) [@addywaddy](https://www.ruby-forum.com/u/addywaddy)\
**Post date:** [January 28, 2007, 9:45pm UTC](https://www.ruby-forum.com/t/problems-with-acts-as-paranoid-noticed-while-using-acts-as/83688/1 "2007-01-28T21:45:42Z")

</div>

hello,  
I’m using the trunk versions of both plugins.

I’m running into this error when I run a migration to try and create  
the versioned table for the model ‘Note’

stack level too deep  
/Users/Adam/dev/sweetspot/app/trunk/config/…/vendor/plugins/  
acts\_as\_paranoid/init.rb:5:in `belongs_to_without_deleted' /Users/Adam/dev/sweetspot/app/trunk/config/../vendor/plugins/ acts_as_paranoid/init.rb:5:in`belongs\_to\_without\_deleted’  
/Users/Adam/dev/sweetspot/app/trunk/config/…/vendor/plugins/  
acts\_as\_paranoid/init.rb:5:in `belongs_to' /Users/Adam/dev/sweetspot/app/trunk/config/../vendor/plugins/ acts_as_versioned/lib/acts_as_versioned.rb:224:in`acts\_as\_versioned’  
/Users/Adam/dev/sweetspot/app/trunk/config/…/app/models/note.rb:2

All note.rb contains is this:  
class Note \< ActiveRecord::Base  
acts\_as\_versioned  
end

looking at the code in acts\_as\_paranoid, I can’t figure out why it is  
getting stuck in a loop:

def belongs\_to\_with\_deleted(association\_id, options = {})  
with\_deleted = options.delete :with\_deleted  
returning belongs\_to\_without\_deleted(association\_id, options) do  
if with\_deleted  
reflection = reflect\_on\_association(association\_id)  
association\_accessor\_methods(reflection,  
Caboose::Acts::BelongsToWithDeletedAssociation)  
association\_constructor\_method(:build, reflection,  
Caboose::Acts::BelongsToWithDeletedAssociation)  
association\_constructor\_method(:create, reflection,  
Caboose::Acts::BelongsToWithDeletedAssociation)  
end  
end  
end

alias\_method\_chain :belongs\_to, :deleted

belongs\_to\_without\_deleted should call the original ‘belongs\_to’  
method, but in this case it is calling ‘belongs\_to\_with\_deleted’.

I’m stumped! Does anyone have any ideas on what might be going on  
here?

Thank you in advance,  
Adam
