Closed gamecreature closed 8 years ago
Hi there, so sorry to see that caused a bug. I don't think it's that line, rather, we're not checking for the existence of the instance variable before trying to remove it.
How about this as a solution?
after_commit 'remove_instance_variable(:@scope_changed) if defined?(@scope_changed)'
Try bundling this branch and see if that fixes the problem. The tests probably didn't pick this up because the tests all trigger the creation of the variable.
Thank you very much for your quick response This indeed fixes my problem! 👍
I'm glad to hear it :) I think the actual reason the tests didn't pick up the problem is that tests are run in a transaction, so this piece of code actually never runs. I'm looking to add something that tests that callback and I'll push a new gem version soon.
0.7.4 should work for you now :) Thanks again for raising this.
Thank you for fixing this...!! 👍
Thanks @brendon for the quick fix!
You're welcome. I've yanked the 0.7.3 gem to be sure.
Came here to say please yank the 0.7.3 version.
I'm using spree which combines acts_as_list and awesome_nested_set set.
With 0.7.2 everything works perfectly With version 0.7.3 the error below happens. After some painful debugging I noticed @scope_changed was coming from acts_as_list. Reverting acts_as_list to the 0.7.2 versions fixes it.
I assume the reason is there isn't an instance_variable @scope_changed when the record is committed.
So I guess the line of commit (5cba2f292feca6f7f54209b48ff57077ad1dbbcf)
was pretty important, for defining this variable?