Alan Smith
2008-Apr-16 14:27 UTC
Will acts_as_taggable_on_steroids and better_nested_set work together?
I am having this crazy problem where it ONLY shows up in testing. This is my test code <code> def test_should_destroy task1 = Task.new(:description => "tmp", :done => false, :user => User.find_by_login(''admin'')) assert task1.save assert task1.destroy end </code> This is my task model <code> class Task < ActiveRecord::Base acts_as_taggable acts_as_nested_set belongs_to :user validates_presence_of :user end </code> The result of running the test: 1) Error: test_should_destroy(TaskTest): SystemStackError: stack level too deep /Users/alan/Projects/superb/vendor/plugins/acts_as_taggable_on_steroids/lib/acts_as_taggable.rb:220:in `reload_without_tag_list'' /Users/alan/Projects/superb/vendor/plugins/acts_as_taggable_on_steroids/lib/acts_as_taggable.rb:220:in `reload'' /Users/alan/Projects/superb/vendor/plugins/betternestedset/lib/better_nested_set.rb:161:in `before_destroy'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:322:in `send'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:322:in `callback'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/callbacks.rb:294:in `destroy_without_transactions'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in `destroy'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:80:in `transaction'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:100:in `transaction'' /Library/Ruby/Gems/1.8/gems/activerecord-2.0.2/lib/active_record/transactions.rb:104:in `destroy'' ./test/unit/task_test.rb:37:in `test_should_destroy'' /Library/Ruby/Gems/1.8/gems/activesupport-2.0.2/lib/active_support/testing/default.rb:7:in `run'' If I comment out "acts_as_taggable", then the test runs fine. What is really driving me crazy is that in normal execution, the destroy works just fine. ANY help or IDEAS would be GREATLY GREATLY GREATLY appreciated. Thanks in advance, Alan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Alan Smith
2008-Apr-16 16:02 UTC
Re: Will acts_as_taggable_on_steroids and better_nested_set work together?
I found this: which is helping to unravel the puzzle: http://rubyforge.org/pipermail/backgroundrb-devel/2008-February/001526.html This was based off a problem in backgroundrb, but is EXACTLY what I am seeing when running tests. Any suggestions on how to make the similiar modifications that micha made to backgroundrb so that the tests will run? Thanks in advance, Alan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Apr-16 16:08 UTC
Re: Will acts_as_taggable_on_steroids and better_nested_set work together?
On 16 Apr 2008, at 17:02, Alan Smith wrote:> > I found this: which is helping to unravel the puzzle: > http://rubyforge.org/pipermail/backgroundrb-devel/2008-February/001526.html > > This was based off a problem in backgroundrb, but is EXACTLY what I am > seeing when running tests. Any suggestions on how to make the > similiar modifications that micha made to backgroundrb so that the > tests will run?Similar but different. I bet that some where you are explicitly requiring your acts as taggable model (causing it to re-alias reload) Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Alan Smith
2008-Apr-16 16:34 UTC
Re: Will acts_as_taggable_on_steroids and better_nested_set work together?
Fred, Where would you look? --Alan On Wed, Apr 16, 2008 at 11:08 AM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On 16 Apr 2008, at 17:02, Alan Smith wrote: > > > > > I found this: which is helping to unravel the puzzle: > > http://rubyforge.org/pipermail/backgroundrb-devel/2008-February/001526.html > > > > This was based off a problem in backgroundrb, but is EXACTLY what I am > > seeing when running tests. Any suggestions on how to make the > > similiar modifications that micha made to backgroundrb so that the > > tests will run? > > Similar but different. I bet that some where you are explicitly > requiring your acts as taggable model (causing it to re-alias reload) > > Fred > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Apr-16 16:35 UTC
Re: Will acts_as_taggable_on_steroids and better_nested_set work together?
On 16 Apr 2008, at 17:34, Alan Smith wrote:> > Fred, > Where would you look? >Anywhere in the app.> --Alan > > > On Wed, Apr 16, 2008 at 11:08 AM, Frederick Cheung > <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> >> >> On 16 Apr 2008, at 17:02, Alan Smith wrote: >> >>> >>> I found this: which is helping to unravel the puzzle: >>> http://rubyforge.org/pipermail/backgroundrb-devel/2008-February/001526.html >>> >>> This was based off a problem in backgroundrb, but is EXACTLY what >>> I am >>> seeing when running tests. Any suggestions on how to make the >>> similiar modifications that micha made to backgroundrb so that the >>> tests will run? >> >> Similar but different. I bet that some where you are explicitly >> requiring your acts as taggable model (causing it to re-alias reload) >> >> Fred >> >>> >> > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Apr-16 16:46 UTC
Re: Will acts_as_taggable_on_steroids and better_nested_set work together?
On 16 Apr 2008, at 17:35, Frederick Cheung wrote:> > On 16 Apr 2008, at 17:34, Alan Smith wrote: > >> >> Fred, >> Where would you look? >> > Anywhere in the app.And by that I mean absolutely anywhere - tests too.> >> --Alan >> >> >> On Wed, Apr 16, 2008 at 11:08 AM, Frederick Cheung >> <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>> >>> >>> On 16 Apr 2008, at 17:02, Alan Smith wrote: >>> >>>> >>>> I found this: which is helping to unravel the puzzle: >>>> http://rubyforge.org/pipermail/backgroundrb-devel/2008-February/001526.html >>>> >>>> This was based off a problem in backgroundrb, but is EXACTLY what >>>> I am >>>> seeing when running tests. Any suggestions on how to make the >>>> similiar modifications that micha made to backgroundrb so that the >>>> tests will run? >>> >>> Similar but different. I bet that some where you are explicitly >>> requiring your acts as taggable model (causing it to re-alias >>> reload) >>> >>> Fred >>> >>>> >>> >> >> >> >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Alan Smith
2008-Apr-16 18:09 UTC
Re: Will acts_as_taggable_on_steroids and better_nested_set work together?
I don''t understand. It is part of the task model (as shown in the code in the first post.) This means that it would be included both in development and test environments. So why do I only have the problem in the test environment? --Alan On Wed, Apr 16, 2008 at 11:46 AM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 16 Apr 2008, at 17:35, Frederick Cheung wrote: > > > > > On 16 Apr 2008, at 17:34, Alan Smith wrote: > > > >> > >> Fred, > >> Where would you look? > >> > > Anywhere in the app. > And by that I mean absolutely anywhere - tests too. > > > > > >> --Alan > >> > >> > >> On Wed, Apr 16, 2008 at 11:08 AM, Frederick Cheung > >> <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >>> > >>> > >>> > >>> On 16 Apr 2008, at 17:02, Alan Smith wrote: > >>> > >>>> > >>>> I found this: which is helping to unravel the puzzle: > >>>> http://rubyforge.org/pipermail/backgroundrb-devel/2008-February/001526.html > >>>> > >>>> This was based off a problem in backgroundrb, but is EXACTLY what > >>>> I am > >>>> seeing when running tests. Any suggestions on how to make the > >>>> similiar modifications that micha made to backgroundrb so that the > >>>> tests will run? > >>> > >>> Similar but different. I bet that some where you are explicitly > >>> requiring your acts as taggable model (causing it to re-alias > >>> reload) > >>> > >>> Fred > >>> > >>>> > >>> > >> > >> >> > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Apr-16 18:47 UTC
Re: Will acts_as_taggable_on_steroids and better_nested_set work together?
On Apr 16, 7:09 pm, "Alan Smith" <alan0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I don''t understand. It is part of the task model (as shown in the > code in the first post.) This means that it would be included both in > development and test environments. So why do I only have the problem > in the test environment? >Well one possibility is that that the require happens from a test file, in which case it''s obvious why it only happens in test environment. The other is that in test you load all the models/tests in one go, whereas in development mode for any one action only those models/controllers that are used are loaded, and they are then unloaded: if the problem is 2 different files causing the task model to be loaded twice, then you might never see it in dev mode if any action would only require one of those actions to be loaded. Fred> --Alan > > On Wed, Apr 16, 2008 at 11:46 AM, Frederick Cheung > > <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On 16 Apr 2008, at 17:35, Frederick Cheung wrote: > > > > On 16 Apr 2008, at 17:34, Alan Smith wrote: > > > >> Fred, > > >> Where would you look? > > > > Anywhere in the app. > > And by that I mean absolutely anywhere - tests too. > > > >> --Alan > > > >> On Wed, Apr 16, 2008 at 11:08 AM, Frederick Cheung > > >> <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > >>> On 16 Apr 2008, at 17:02, Alan Smith wrote: > > > >>>> I found this: which is helping to unravel the puzzle: > > >>>>http://rubyforge.org/pipermail/backgroundrb-devel/2008-February/00152... > > > >>>> This was based off a problem in backgroundrb, but is EXACTLY what > > >>>> I am > > >>>> seeing when running tests. Any suggestions on how to make the > > >>>> similiar modifications that micha made to backgroundrb so that the > > >>>> tests will run? > > > >>> Similar but different. I bet that some where you are explicitly > > >>> requiring your acts as taggable model (causing it to re-alias > > >>> reload) > > > >>> Fred--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Alan Smith
2008-Apr-16 19:18 UTC
Re: Will acts_as_taggable_on_steroids and better_nested_set work together?
I FOUND IT!!! Thanks for your help. The problem... I had "require tasks". Then I also had "fixtures :all". The fixtures line caused the task to be required again. --Alan On Wed, Apr 16, 2008 at 1:47 PM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On Apr 16, 7:09 pm, "Alan Smith" <alan0...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I don''t understand. It is part of the task model (as shown in the > > code in the first post.) This means that it would be included both in > > development and test environments. So why do I only have the problem > > in the test environment? > > > Well one possibility is that that the require happens from a test > file, in which case it''s obvious why it only happens in test > environment. The other is that in test you load all the models/tests > in one go, whereas in development mode for any one action only those > models/controllers that are used are loaded, and they are then > unloaded: if the problem is 2 different files causing the task model > to be loaded twice, then you might never see it in dev mode if any > action would only require one of those actions to be loaded. > > Fred > > > --Alan > > > > On Wed, Apr 16, 2008 at 11:46 AM, Frederick Cheung > > > > > <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > On 16 Apr 2008, at 17:35, Frederick Cheung wrote: > > > > > > On 16 Apr 2008, at 17:34, Alan Smith wrote: > > > > > >> Fred, > > > >> Where would you look? > > > > > > Anywhere in the app. > > > And by that I mean absolutely anywhere - tests too. > > > > > >> --Alan > > > > > >> On Wed, Apr 16, 2008 at 11:08 AM, Frederick Cheung > > > > >> <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > >>> On 16 Apr 2008, at 17:02, Alan Smith wrote: > > > > > >>>> I found this: which is helping to unravel the puzzle: > > > >>>>http://rubyforge.org/pipermail/backgroundrb-devel/2008-February/00152... > > > > > > > >>>> This was based off a problem in backgroundrb, but is EXACTLY what > > > >>>> I am > > > >>>> seeing when running tests. Any suggestions on how to make the > > > >>>> similiar modifications that micha made to backgroundrb so that the > > > >>>> tests will run? > > > > > >>> Similar but different. I bet that some where you are explicitly > > > >>> requiring your acts as taggable model (causing it to re-alias > > > >>> reload) > > > > > >>> Fred > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---