troessner/transitions

Stack level to deep

pointblack opened this issue · 4 comments

With the change from Rails 3.1.10 to Rails 3.2.13 i get following error when trying to run specs:

/.rvm/gems/ruby-1.8.7-p334@riptide/gems/transitions-0.1.8/lib/active_model/transitions.rb:34:in `old_transitions_initialize': stack level too deep (SystemStackError)

from /.rvm/gems/ruby-1.8.7-p334@riptide/gems/transitions-0.1.8/lib/active_model/transitions.rb:36:in `initialize'
from /.rvm/gems/ruby-1.8.7-p334@riptide/gems/transitions-0.1.8/lib/transitions.rb:45:in `new'
from /.rvm/gems/ruby-1.8.7-p334@riptide/gems/transitions-0.1.8/lib/transitions.rb:45:in `state_machine'

Im using Rails 3.2.13 and Transitions gem 0.1.8

StateMachine is defined as following in the model:

  state_machine do
    state :pending
    state :accepted
    state :terminated
    event :accept do
      transitions :to => :accepted, :from => :pending
    end
    event :terminate do 
      transitions :to => :terminated, :from => [:pending, :accepted]
    end
  end

Interesting. Please have a look at this issue: #83
Looking at what you posted above (apparently you're still on 1.8.7), it seems like this could indeed have something to do with the ruby version.

Could you try to reproduce this on ruby 1.9.3 or 2.0?

yes i can cofirm with the update to ruby 1.9.3 its working

Thanks, good to know. Here's the thing though: I am extremely hesitant to fix something which is specific to a ruby version which will soon not be supported anymore. I'd rather mark the gem as not compatible with 1.8.7.
Can you switch to ruby 1.9 / 2.0 or do you have to stick with 1.8?

Closing this. I'd be accepting pull request fixing this but I won't spend time on fixing errors that only occur on outdated ruby versions. I added a corresponding compatibilty section to our documentation.