Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I ran into the issue that has occurred for multiple programmers.
Issues:
#37(Different issue: this is.hash_tree
from a non-tree relation)#76(Different issue: this was fixed many versions ago, and has test coverage)#28(Different issue: this was fixed many versions ago, and has test coverage)The issue is occurring because the call to hash_tree is on an already-scoped ActiveRecord relation, and your previous tests only cover Class.hash_tree.
example:
I have updated all your tests to accommodate for the desired/intended behavior, and they all pass. I then wrote my own test that demonstrates the issue occurring and the test fails.
Let me know if you need any more info from me. The issue is occurring on line 52 of /lib/closure_tree/hash_tree.rb and it seems like there needs to be another conditional statement on line 49 to fix the problem, but I haven't had time to throw bricks at it yet. It might be an easy fix for you, @mceachen, so I thought I'd let you take a look.
Btw, I love this gem :). Nice work!