I've been using the ancestry gem but I ran into an issue a little while ago. I created a ticket over there but haven't been able to think of a particularly good solution yet:
The ticket has all the info, but the basic idea is that in callbacks (and apparently validations) you get a scope applied to you.
I can imagine one might want the scope applied to callbacks/validations, but can't immediately think of a case.
I've been poking through the ActiveRecord source to see if there's way to undo a part of the scope or somehow mark a part of the scope to be undone in certain situations. I don't know how much I like that idea, but just unscoping everything isn't desirable either. Thoughts?
I think you're looking for only and except. You also have unscoped if you want to remove everything.
Thanks ;) I saw only and except but I wasn't sure that they were the solution to the problem. I've gone with except for the time being since I can't think of a good example where it wouldn't work.
Fix typo in pool_conections_test [#1350 state:committed]
Signed-off-by: David Heinemeier Hansson <email@example.com>