Quite wierd, but also annoying.
I have a few habtm associations in my app, eg, users -> roles and roles -> permissions.
Now deleting a role is easy and works. But when I want to delete a user it fails. I get the following error.
SystemStackError: stack level too deep
from .//vendor/rails/activerecord/lib/active_record/associations/association_collection.rb:62:in `clear'
from (eval):3:in `destroy_without_habtm_shim_for_roles'
from (eval):4:in `destroy_without_habtm_shim_for_roles'
from (eval):4:in `destroy_without_callbacks'
from .//vendor/rails/activerecord/lib/active_record/callbacks.rb:321:in `destroy_without_transactions'
from .//vendor/rails/activerecord/lib/active_record/transactions.rb:122:in `destroy'
from .//vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:51:in `transaction'
from .//vendor/rails/activerecord/lib/active_record/transactions.rb:91:in `transaction'
from .//vendor/rails/activerecord/lib/active_record/transactions.rb:118:in `transaction'
from .//vendor/rails/activerecord/lib/active_record/transactions.rb:122:in `destroy'
from (irb):2
I've run it from both trunk and stable, but neither seem to work. I decided to look back at any possible changes that mightve caused this. Unfortunately we havent been running tests like we should be, so this is partially my fault, but I foud a change, in changeset 2940, for associations.rb this is where the problem starts. I didnt revert back to 2940, but merely switched over the code in the section to the old version and now im able to delete again.
I hope this is able to be fixed as its just a normal habtm association.