collectiveidea/awesome_nested_set — Issue #100: Unable to call move_to* methods using MultiDB setup
Author: jnaru
Created: 2011-10-28 21:50:59+00:00
State: open

I have a Ruby 1.8.7/Rails 2.3.8 setup using schoefmax's MultiDb gem, version 0.2.1, on MySQL.

When I try to call move_to* methods, I get a "stack level too deep" error. Any ideas on how to work around this? I've provided a stack trace below.

```
>> rp.move_to_child_of(rp2)
SystemStackError: stack level too deep
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:16:in `reload_without_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:16:in `reload_without_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/connection_proxy.rb:97:in `with_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:16:in `reload_without_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:16:in `reload_without_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/connection_proxy.rb:97:in `with_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:16:in `reload_without_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:16:in `reload_without_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/connection_proxy.rb:97:in `with_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:16:in `reload_without_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:16:in `reload_without_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/connection_proxy.rb:97:in `with_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:16:in `reload_without_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:16:in `reload_without_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/connection_proxy.rb:97:in `with_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:16:in `reload_without_master'
... 1085 levels...
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:16:in `reload_without_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:16:in `reload'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/connection_proxy.rb:97:in `with_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:16:in `reload'
from /usr/local/lib/ruby/gems/1.8/gems/awesome_nested_set-1.4.4/lib/awesome_nested_set.rb:503:in `reload_nested_set'
from /usr/local/lib/ruby/gems/1.8/gems/awesome_nested_set-1.4.4/lib/awesome_nested_set.rb:511:in `move_to'
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/connection_proxy.rb:104:in `transaction'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/connection_proxy.rb:97:in `with_master'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/connection_proxy.rb:104:in `transaction'
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/transactions.rb:182:in `transaction'
from /usr/local/lib/ruby/gems/1.8/gems/schoefmax-multi_db-0.2.1/lib/multi_db/active_record_extensions.rb:24:in `transaction'
from /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/transactions.rb:188:in `transaction'
from /usr/local/lib/ruby/gems/1.8/gems/awesome_nested_set-1.4.4/lib/awesome_nested_set.rb:509:in `move_to'
from /usr/local/lib/ruby/gems/1.8/gems/awesome_nested_set-1.4.4/lib/awesome_nested_set.rb:405:in `move_to_child_of'
```