Acts_as_paranoid is giving me a headache when performing migrations. For some reason when I perform a migration I get a "stack level too deep" error. If I comment out the database inserts that are performed (countries, regions, and a base admin) it works well. Even after minimizing the data that is inserted on the migration to one record it still throws the same error. When running the migrate with the --trace option I get the following: ========rake aborted! stack level too deep /Users/chris/Documents/Projects/Rails/my_app/vendor/plugins/acts_as_paranoid/init.rb:4:in `belongs_to_without_deleted'' /Users/chris/Documents/Projects/Rails/my_app/vendor/plugins/acts_as_paranoid/init.rb:4:in `belongs_to_without_deleted'' /Users/chris/Documents/Projects/Rails/my_app/vendor/plugins/acts_as_paranoid/init.rb:4:in `belongs_to'' /Users/chris/Documents/Projects/Rails/my_app/app/models/region.rb:2 I get the same error if I remove all the acts_as_paranoid calls from the classes that use it. Although I am error free when I remove the acts_as_paranoid plugin from the project. Any ideas on how to fix this or suggestions for a better plugin? Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I have created a rake task to do the data imports after the migration is complete, which works. I also created another test app and used some of the tables and data that *seemed* to be causing the problem, but the migration worked fine, so there must be something else that is causing the problem. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Olsen wrote:> I have created a rake task to do the data imports after the migration is > complete, which works. I also created another test app and used some of > the tables and data that *seemed* to be causing the problem, but the > migration worked fine, so there must be something else that is causing > the problem.I had this same problem. For me it was caused by a helper I was including in one of my migrations. It had the following line: require ''config/environment'' This was causing init.rb of acts_as_paranoid to be called twice, and hence the alias_method_chain got screwed up and ended up pointing to itself. Hence the ''stack level too deep'' error. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rob Dupuis wrote:> I had this same problem. For me it was caused by a helper I was > including in one of my migrations. It had the following line: > > require ''config/environment'' > > This was causing init.rb of acts_as_paranoid to be called twice, and > hence the alias_method_chain got screwed up and ended up pointing to > itself. Hence the ''stack level too deep'' error.Thanks for the update. I don''t even remember what I did, but I was able to get things working again a few days after the issue. I, most likely, deleted and re-created the file with the require statement that you described. I am sure this info will come in handy later on. Cheers -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Chris Olsen wrote:> I, most likely, > deleted and re-created the file with the require statement that you > described.Just for clarity, it was deleting the require statement that fixed the problem for me. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Possibly Parallel Threads
- gettext and acts_as_paranoid gives stack overflow
- problems with acts_as_paranoid (noticed while using acts_as_versioned)
- acts_as_paranoid and alias_method_chain
- Will acts_as_paranoid work with attachment_fu?
- acts_as_paranoid --> undefined method `constrain' for class `Class'