-
-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined instance variable @scope_changed since 0.7.3 #199
Comments
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 |
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 (5cba2f2)
was pretty important, for defining this variable?
The text was updated successfully, but these errors were encountered: